Removes the trailing and leading whitespace from a string. |
||
Syntax |
r = string.trim(str) |
|
Argument |
Name |
Description |
|
str |
A string. |
Outputs |
Name |
Description |
|
r |
A string. |
Example |
To remove the leading and trailing white space. |
|
|
Syntax |
|
|
str = ' This is a string with spaces at the beginning and at the end. ' ; r = string.trim(str); print('|' + str + '|'); print('|' + r + '|'); |
|
|
Result |
|
|
| This is a string with spaces at the beginning and at the end. | |This is a string with spaces at the beginning and at the end.| |