reference-en icon indicating copy to clipboard operation
reference-en copied to clipboard

Define "whitespace" in String `trim` reference

Open jellewie opened this issue 6 years ago • 0 comments

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

  1. Update the website to state what the 'whitespaces' are, and thus what it removes with 'trim()'
  2. That the function is to be fixed and /r and /n being added to 'trim()' (and update the webpage?)

jellewie avatar Oct 22 '19 06:10 jellewie