Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Random question

Name: Anonymous 2009-11-25 21:52

Using c++, I have a string vector containing thousands of elements. I know I can erase a specific element using:

vectorName.erase(remove(vectorName.begin(),vectorName.end(),"whatever"),vectorName.end());

In that example it would get rid of any vector elements that equaled "whatever".

I'm looking to erase certain elements if anywhere in that element it has a certain combination of letters. In my case, I want to erase any URLs that make it into the vector, so I would erase any element that contained "http" or "www" in it.

I tried googling this, but I have no clue what to look for. Can anyone offer their expertise? Is there a one line solution using vectorName.erase()?

Name: Anonymous 2009-11-28 21:17

>>31
You couldn't achieve this much information density in Perl code.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List