Operator Type:
Operator Scope of Action:
Operator Purpose:
Operator First Added:
Operator in Current Baseline:
Operator Last Altered:
Operator Has Optional Arguments:
Function [other Function type actions]
Item [operators of similar scope]
Data manipulation [other Data manipulation operators]
v9.0.0
Baseline
As at baseline
Syntax note: Operators without any defined mandatory arguments may omit their empty closing parentheses
String.trim([filterStr])
String.trim()
String.trim
The .trim operator removes unwanted characters from the start and end of a string. With no arguments, .trim() removes whitespace and end of line characters.
"Hello world ".trim;
→ "Hello world"
It may also be used with a literal string argument filterStr. The only accepted value for filterStr is "punctuation", in which case the operator also removes punctuation marks.
"[tab] Hello world?! ".trim("punctuation")
→ "Hello world"
The resulting string retains any stying in the source string.