I am currently working on string processing because I have not learned it. I have a string = <html><p>Hello < / P>. I am simply trying to remove all characters in between and including the <, > symbol. In the end it should just say Hello because it is not surrounded by <, >. Any tips in the right direction or tips would be helpful. I would like to stick with the text.erase and text.length functions if possible.
#include <iostream>
#include <string>
usingnamespace std;
int main() {
string text = "<html><p>Hello < / P>";
cout << text << endl;
for (int a = 0; a < text.length(); a++)
{
if (text[a] == '<')
{
//use the erase code to get rid of all items
text.erase(0, 0);
a--;
}
elseif (text[a] == '>')
{
}
}
cout << text << endl;
}