reference-en
reference-en copied to clipboard
Define "whitespace" in String `trim` reference
https://www.arduino.cc/reference/en/language/variables/data-types/string/functions/trim/ It states that it removes 'any leading and trailing whitespace' 'whitespace' isn't declared, Some websites states that /r/n are also whitespaces (char 10+13) but it does not remove these.
What happened a string with /r/n at the end, did not get the /r/n removed String a = "test" + char(10) + Char(13); Serial.print(a.trim().length());
What I expected That the /r and /n were removed from the string (they are whitespaces in my opinion)
What should happen Either
- Update the website to state what the 'whitespaces' are, and thus what it removes with 'trim()'
- That the function is to be fixed and /r and /n being added to 'trim()' (and update the webpage?)