-
Trimming a string?
I did a sql statement to select a user name.
Dim strName as String
...
...
The Access database has a text with a length being 128
however I selected a name "Sam Winston" which has a length less then 128. I get the following
info in strName
strName = "Sam Winston " up to 128 bytes.
Is there a way for me to trim of all the spaces after the last name so it looks like this:
strName = "Sam Winston"
Thanks
-
Re: Trimming a string?
YourStrim = RTrim("YorString ") gives you YouString without leading spaces.
-
Re: Trimming a string?
strString = RTrim$(strString) 'will trim spaces on right
strString = LTrim$(strString) 'will trim spaces on left
strString = Trim$(strString) 'will trim spaces on both left and right