Description
Trims a string.
Syntax
Syntax 1
trim stringValue
Parameters:
stringValue: String - string to be trimmed. spaces, tabs and line returns are removed from both ends of stringValue.
Returns: String - trimmed string
Syntax 2
string trim [chars, where]
Parameters:
string: String - string to be trimmedchars: String - list of characters to be trimmedwhere: Number one of:- 0 - trim at the beginning (left) and the end (right)
- 1 - trim at the beginning (left)
- 2 - trim at the end (right)
Returns: String - trimmed string
Examples
Example 1
trim " hello, how are you? "; // returns "hello, how are you?"
Example 2
"hewosentence!123" trim ["3e1o2hw", 0]; // returns "sentence!"