This program provides various string manipulation functions written in C. It can convert a string to uppercase or lowercase, replace non-alphanumeric characters with a custom separator, and replace numbers with their English word equivalents. This project was originally a homework assignment and has since become a great exercise for practicing C programming skills.
This C program manipulates strings using the following functionalities:
- Converts strings to uppercase or lowercase.
- Replaces non-alphanumeric characters with a specified separator.
- Replaces digits with their English word equivalents (e.g., '1' becomes 'one').
- Combines these functionalities for flexible string modifications.
- toUpper: Converts a string to uppercase.
- toLower: Converts a string to lowercase.
- replaceWithSeparator: Replaces non-alphanumeric characters with a specified separator.
- replaceNumberWithEnglishSubstitute: Converts numbers in the string to their English word equivalents.
- modifyString: A combined function that performs the following:
- Replaces non-alphanumeric characters.
- Converts digits to words.
- Changes the case of the string (uppercase or lowercase).
You will need a C compiler to compile and run the program. You can use either gcc or clang.
To compile the program, run the following command:
gcc -o string_manipulation string_manipulation.cOnce compiled, you can run the program like this:
./string_manipulationBy default, the program will modify the string "!!!Hello 1234 World!!!", replacing non-alphanumeric characters with a dash (-), converting numbers to words, and converting the string to lowercase.
Given the input string "!!!Hello 1234 World!!!" with the separator '-' and the option to convert to lowercase, the output will be:
hello-onetwothreefour-world
If you'd like to contribute to this program, feel free to fork the repository and submit a pull request. Suggestions and improvements are always welcome!