hey, ive got a pretty basic issue here, im trying to remove the chars '<' and '>' and the text between them.
the code below is my attempt at this, but instead of serial printing "theres a really ugly tag before this, this, this" i get "theres a really ugly tag before this"
an image of my serial monitor. the text printed first is the un-edited string, and the one after is an attempt to remove text between the '<' and '>'
String payload = "<tag>theres an ugly tag before this,<bigtag>this,<reallybigtag>this,";
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
delay(1000);
tagstrip(payload);
Serial.println(" ");
Serial.println(" ");
Serial.println(payload);
}
void loop() {
// put your main code here, to run repeatedly:
}
int howmuch = 0;
void tagstrip(String mystring){
for(int i = 0; i < mystring.length();i++){
int tagend = -1;
int tagstart = -1;
tagstart = mystring.indexOf('<');
tagend = mystring.indexOf('>');
mystring.remove(tagstart,tagend - tagstart);
payload = mystring;
}
}