I am trying to execute some webbased calls, but my string keep "disappearing", and I am highly confused about why.
I can println a string directly, but if I have it in a variable, it will disappear :I
I tried googling around, but could not find a reason for it. Is it because of the curly brackets ? Is it a memory issue ?
I feel I really can't code on and juggle web calls, if I can't even handle regular string commands..
Code:
Serial.println(" - CONSOLE/STRING WEIRDNESS - ");
String message = "Testing time {0}";
Serial.println(message);
Serial.println(String(message));
Serial.println("Testing time {0}");
Serial.println(message.substring(3,6));
Response:
- CONSOLE/STRING WEIRDNESS -
(nothing)
(nothing)
Testing time {0}
(nothing)
Update
This seems to happen whenever there is a number inside a string, it even happends with a simple string like this:
Code:
Serial.println(" - CONSOLE/STRING WEIRDNESS - ");
String message = "Testing time here is a number 0";
Serial.println(message);
Serial.println(String(message));
Serial.println("Testing time here is a number 0");
Serial.println(message.substring(3,6));
Response:
- CONSOLE/STRING WEIRDNESS -
(nothing)
(nothing)
Testing time here is a number 0
(nothing)