-
Remove " character
How would I remove the " character from a string. The only way in which I know how to remove a character is by putting it within "s. like
Code:
string stripPBreaks(string s) {
int br;
while((br = s.find("<P>")) != string::npos)
s.erase(br, strlen("<P>"));
while((br = s.find("</P>")) != string::npos)
s.erase(br, strlen("</P>"));
return s;
}
-
Figured it out. Need to put \ before it. Tried putting in ' ' but that gave me an error.
-
\ is known as an escape character. So a \ followed by various characters lets you insert things into strings you normally can't e.g. \n is a new line, \" is a quotation mark, etc. If you google you should be able to find a list of them fairly easily.