We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I have incoming strings containing 1 or more leading spaces and then digits. What's the easiest way to convert these to integer? I've just found that int(" 4") is zero. I'm surprised at this as I think several other languages that I've used, e.g. C ignore leading whitespace on the conversion. Alright, is there anything for trimming whitespace? I can write my own using String.charAt and .substring, but I'm thinking I there's probably a well-trodden easier way.
Answers
trim()
https://www.processing.org/reference/trim_.html
Yes, that makes it easier, thanks.
;-)