Trim white chars: Difference between revisions

From Cuis CookBook
Jump to navigation Jump to search
(importe material)
 
(hilligh)
 
Line 1: Line 1:
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.
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.<syntaxhighlight lang="smalltalk">
' Hello World ' withBlanksTrimmed . "=> 'hello world' "
' Hello World ' withBlanksTrimmed . "=> 'hello world' "
</syntaxhighlight>

Latest revision as of 09:53, 5 May 2025

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' "