Tinderbox v9 Icon

String.trim([filterStr])


Operator Type: 

Operator Scope of Action: 

Operator Purpose: 

Operator First Added: 

Operator Last Altered: 

Operator Has Optional Arguments: 

 Function  [other Function type actions]

 Item  [operators of similar scope]

 Data manipulation  [other Data manipulation operators]

 Baseline

 As at baseline

 [More on optional operator arguments]


String.trim([filterStr])

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 pamy asle be use with a literal string argument filterStr. The only accepted value for filterStr is "punctuation", in which cas the operator also removes punctuation marks.

"[tab] Hello world?! ".trim("punctuation") → "Hello world"

The resulting string retains any stying in the source string.