String.trim() returns void ???

What's up with this:

https://www.arduino.cc/reference/en/language/variables/data-types/string/functions/trim/

Strings are supposed to be immutable!

C/C++ doesn't have a concept of immutable, it does however have const.

it is not Java

skyjumper:
Strings are supposed to be immutable!

Where did you get that idea?

johnwasser:
Where did you get that idea?

Like @Juraj said, it's a java/python thing. I don't know what the OP's trying to accomplish with this post.

My mistake, I do the vast majority of my work in Java and I was half asleep when I posted that. I had done something like:

String newString = myString.substr(3).trim().toUpperCase();

Which of course failed. I let my frustration get the better of me, sorry.