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

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -