// Comment
#include
#include
int main()
{
char text[100],sub[20],new_text[100];
int i=0,j,k,temp=0,n=0;
printf("[+]Enter the Text: ");
gets(text);
printf("\n [+]Enter Substring to be deleted : ");
gets(sub);
while(text[i]!='\0')
{
j=0,k=i;
while(text[k]==sub[j] && sub[j]!='\0')
{
k++;
j++;
}
if(sub[j]=='\0')
temp=k;
new_text[n]=text[temp];
i++;
temp++;
n++;
}
new_text[n]='\0';
printf("[+]\n The new string is : ");
puts(new_text);
return 0;
}
output
[+]Enter the Text: tutorial.spicyztrickz.com
[+]Enter Substring to be deleted : tutorial.
[+]
The new string is : spicyztrickz.com
Process returned 0 (0x0) execution time : 40.160 s
Press any key to continue.
Post a Comment