I have vector in class declaration which holds strings.
vector<string> which contains strings like
"test1"
"test2"
"test4"
"test1"
"test1"
In this case, I would like to remove all occurrence of "test1" from vector.
like, RemovefromVector("test1") results in (vector contains now only)
"test2"
"test4"
You want the remove algorithm. It's described in the Reference section, under STL Algorithms. It returns an iterator to the new end of the container (algorithms cannot actually erase elements).
Effective STL by Scott Meyers is an excellent start; I recommend going that route. You can pick up a used one online at a good price and it's a short read, too!