Removes whitespace characters from the beginning and end of a String. In addition to standard whitespace characters such as space, carriage return, and tab, this function also removes the Unicode "nbsp" (U+00A0) character and the zero width no-break space (U+FEFF) character. @webref data:string_fun
(String str)
| 8283 | * @see PApplet#join(String[], char) |
| 8284 | */ |
| 8285 | static public String trim(String str) { |
| 8286 | if (str == null) { |
| 8287 | return null; |
| 8288 | } |
| 8289 | // remove nbsp *and* zero width no-break space |
| 8290 | return str.replace('\u00A0', ' ').replace('\uFEFF', ' ').trim(); |
| 8291 | } |
| 8292 | |
| 8293 | |
| 8294 | /** |
no test coverage detected