String.Trim

From Xojo Documentation

Method

Returns the string passed with leading and trailing whitespaces removed.

Syntax

result=stringVariable.Trim

Part Type Description
result String source with leading and trailing whitespaces removed.
stringVariable String A string variable, a copy of which is returned with leading and trailing whitespaces removed.

Notes

Trim uses the list of unicode "whitespace" characters at http://www.unicode.org/Public/UNIDATA/PropList.txt.

Examples

This example removes the whitespaces from either side of the string passed:

Var source as String = " Hello World "
Var result as String = source.Trim // Returns "Hello World"

See Also

String for a complete list of functions.