RTRIM(string)

Returns the text string without trailing spaces (Variant / String).


stringThe text string (String).

REMARKS
* If "string" is Null, then Null is returned.
* This function is similar to LTRIM function.
* You can use the LTRIM function to return a text string without leading spaces.
* You can use the RTRIM$ function to return a String data type instead of a Variant data type.
* You can use the RIGHT function to return a number of characters from the right of a string.
* You can use the TRIM function to return a text string without leading and trailing spaces.
* The equivalent .NET function is Microsoft.VisualBasic.Strings.RTrim
* For the Microsoft documentation refer to learn.microsoft.com

Debug.Print "'" & RTrim("   some text") & "'"            '= '    some text'  
Debug.Print "'" & RTrim(" some text ") & "'" '= ' some text'
Debug.Print "'" & RTrim("some text ") & "'" '= 'some text'
Debug.Print "'" & RTrim(LTrim(" some text ")) & "'" '= 'some text'
Debug.Print "'" & RTrim(Null) & "'" ''

© 2022 Better Solutions Limited. All Rights Reserved. © 2022 Better Solutions Limited Top