String.TrimLeft
From Xojo Documentation
Method
Returns the string passed with either whitespaces or the characters passed removed from the left side of the string.
Syntax
result=stringVariable.TrimLeft(Optional ParamArray Characters() As String)
Part | Type | Description |
---|---|---|
result | String | SourceString with leading whitespaces removed. |
stringVariable | String | Any variable of type String. |
Characters() | String | An optional ParamArray of characters that will be trimmed instead of whitespaces. |
Notes
Unless specific characters are passed in, TrimLeft trims whitespace characters as defined by unicode.
Examples
This example removes the whitespaces from the left side of the string passed:
Var source As String = " Hello World "
Var result As String
result = source.TrimLeft // Returns "Hello World "
Var result As String
result = source.TrimLeft // Returns "Hello World "
This example removes * from the left side of the string passed:
Var source as String = "*Hello World"
Var result as String = source.Trim("*") // Returns "Hello World"
Var result as String = source.Trim("*") // Returns "Hello World"
See Also
String.Trim, String.TrimRight functions and String type.