Removing a particular string from a given string in C++ -


to remove given substring, buf, a string, strn, in c++, wrote following code:

int stpos=strn.find(buf); strn.erase(stpos, buf.length()); 

but wondering if there's way of doing ignoring spaces between substring or whether substring in lower or upper case.

for instance, let's assume

strn="ggasfai thekingafs"; buf="iamtheking"; 

then want output

  ggas  afs 

i wondering if there's easier way of doing instead of checking going through strn character character (note output, spaces in strn not removed)


Comments

Popular posts from this blog

single sign on - Logging into Plone site with credentials passed through HTTP -

php - Why does AJAX not process login form? -

java - How to specify maven bin in eclipse maven plugin? -