Method
Trim
Warning
This item was deprecated in version 2019r2. Please use String.Trim as a replacement.
Description
Returns the string passed with leading and trailing whitespaces removed.
Usage
result = Trim(sourceString)
OR
result = stringVariable.Trim
Part |
Type |
Description |
---|---|---|
result |
SourceString with leading and trailing whitespaces removed. |
|
sourceString |
The source, a copy of which, to be returned with leading and trailing whitespaces removed. |
|
stringVariable |
Any variable of type String. |
Notes
Trim uses this list of unicode "whitespace" characters.
Sample code
This example removes the whitespaces from either side of the string passed:
Var s As String
s = Trim(" Hello World ") ' Returns "Hello World"
s = " Hello World "
s = s.Trim ' Returns "Hello World"
Compatibility
All project types on all supported operating systems.
See also
Asc, Chr, String.IndexOf, String.Left, String.Length, String.TrimLeft, String.Middle, String.Right, String.TrimRight functions.