I have to write a program that will input a text paragraph from the user. The maximum size of the string will be 500.I have to write a program in which if user select 'R' or 'r' then user is asked to enter a word he wants to replace and another word that he wants the original word to be replaced with. If the original word exists, it will be replaced with the other word, otherwise word not found message will be displayed.
If user select 'I' or 'i' then the user will be asked to enter an index of the text string at which he/she wants to insert a word. Then he/she is asked to enter the word that he/she wants to insert. The text at the given index is shifted right and the word is then inserted at the given Index. Make sure that the text string has enough space to accommodate the new word. If there is not enough space then Not enough space message should be displayed
When ‘S’ or ‘s’ is entered, All special characters other than ‘.’ and spaces, and all digits will be deleted from the string. Moreover if multiple consecutive spaces exist between words then all those extra spaces will also be removed from the text.