with the characters of text to find if the characters are same if it is not the casethen we move to step where is incremented if the string is foundthen the index is initialized with ielse it is set to - for exampleif text welcome to the world string come in the first pass of the inner loopwe will compare come with welc character by character as and do not matchthe control will move to step and then elco will be compared with come in the fourth passcome will be compared with come we will be using the programming code of pattern matching operation in the operations that follow deleting substring from the main string the deletion operation deletes substring from given text we can write it as delete(textpositionlengthfor exampledelete("abcdxxxabcd" "abcdabcdstep [initializeset iand jstep repeat steps to while text[ !null step if = repeat while nset + set [end of inner loop[end of ifstep set new_str[jtext[istep set step set [end of outer loopstep set new_str[jnull step exit figure algorithm to delete substring from text figure shows an algorithm to delete substring from given text in this algorithmwe first initialize the indices to zero steps to are repeated until all the characters of the text are scanned if is exactly equal to (the position from which deletion has to be done)then the index of the text is incremented and is decremented is the number of characters that have to be deleted starting from position howeverif is not equal to mthen the characters of the text are simply copied into the new_str programming example write program to delete substring from text #include #include int main(char text[ ]str[ ]new_text[ ]int = = found= kn= copy_loop= clrscr()printf("\ enter the main text ")gets(text)printf("\ enter the string to be deleted ")gets(str)while(text[ ]!='\ ' = found= =iwhile(text[ ]==str[ &str[ ]!='\ ' ++ ++