Trim Function

Returns the String passed with leading and trailing whitespaces removed.

Syntax
result = Trim( SourceString )
result = Trim( )

Parameters
SourceString | String | The source, a copy of which, to be returned with leading and trailing whitespaces removed.

Return Value
Result | String | SourceString with leading and trailing whitespaces removed.

# Notes

stringVariable.Trim

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:

Dim s as String
s=Trim(" Hello World ") //Returns "Hello World"

# See Also

Asc, Chr, InStr, Left, Len, LTrim, Mid, Right, RTrim functions.