Skip to content

Trim white chars

Dr. Nicola Mingotti edited this page Dec 11, 2021 · 1 revision

This is one of the first things to do on user input data. Remove white characters at the beginning and the end of the string. This is how to do it.

'   Hello World   ' withBlanksTrimmed . "=> 'hello world' "
Clone this wiki locally