Could anyone here tell me how to get rid of the white spaces of the String(a)!!
String a = "GET /?led=21 HTTP/1.1";
void setup() {
Serial.begin(9600);
Serial.print(a);
}
void loop() {
}
Could anyone here tell me how to get rid of the white spaces of the String(a)!!
String a = "GET /?led=21 HTTP/1.1";
void setup() {
Serial.begin(9600);
Serial.print(a);
}
void loop() {
}
In Arduino you can replace strings by modifying the existing string like this:
a.replace(" ", "");
The String replace() function allows you to replace all instances of a given character with another character. You can also use replace to replace substrings of a String with a different substring.