String.TrimRight
From Xojo Documentation
Method
Returns the string passed with either whitespaces or the characters passed removed from the right side of the string.
Syntax
result=stringVariable.TrimRight(Optional ParamArray Characters() As String)
Part | Type | Description |
---|---|---|
result | String | SourceString with trailing 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, TrimRight trims whitespace characters as defined by unicode.
Examples
This example removes the whitespaces from the right side of the string passed:
Var source As String = " Hello World "
Var result As String
result = source.TrimRight // Returns " Hello World"
Var result As String
result = source.TrimRight // Returns " Hello World"
This example removes * from the right side of the string passed:
Var source as String = "Hello World*"
Var result as String = source.TrimRight("*") // Returns "Hello World"
Var result as String = source.TrimRight("*") // Returns "Hello World"
See Also
String.Trim, String.TrimLeft functions; String data type.