The above answer is correct, but just to let you know, to get noOfSymbols the plus one is not necessary. Since the .find(), gets the value of the position at the beginning of the search string.
In other words, .find(), will place the cursor right before <em>, like so : |<em>.
The .length(), will return the exact length of 4, which will cover the entire string of the tag.
Adding one will put it over by one making it take the character s into consideration, when you use the erase function.
string htmlLine = "<em>suez</em> canal";
string searchEm = "<em>"; // This will not be found because of the extra '/' in the above line.
int posEmStart = static_cast<int>(htmlLine.find(searchEm));
Several things to note in the above snippet. First static_casting the return value from the std::string::find() function is a problem, use the proper type for posEmStart, a size_t. When the find fails, as it is in this instance, the find() function returns the largest value that can be held in a size_t (std::string::npos). Trying to use this value (std::string::npos) for the "start" of the erase will cause an exception to be thrown. Before you try to use values from things like the find() function you should verify the number is not std::string::npos.