一,删除字符串中所有子串
#include<string.h>
#include<stdio.h>void main()
{
printf("p=%s\n",p);
}
结果:p= llo ab
二,删除字符串中第一个子串,把while((q=strstr(p,"Hi"))!=NULL)换成if((q=strstr(p,"Hi"))!=NULL)即可
运行结果:p= Hillo Hi ab
一,删除字符串中所有子串
#include<string.h>
#include<stdio.h>}
结果:p= llo ab
二,删除字符串中第一个子串,把while((q=strstr(p,"Hi"))!=NULL)换成if((q=strstr(p,"Hi"))!=NULL)即可
运行结果:p= Hillo Hi ab