|
-
Nov 29th, 2000, 03:21 AM
#1
Thread Starter
Hyperactive Member
Hello,
How do I get rid of trailing spaces in a string??
I have strings called strName and strSurname, which are populated by fields from a table.
The strName however has trailing spaces which I want to get rid of.
EG. I want to display the name & surname on a msgbox..
msgbox strname & " " & strSurname
the result must be something like.. "John Cooper" - without any spaces (except the one I specified) between the name & surname.
Thanks
-
Nov 29th, 2000, 03:57 AM
#2
Addicted Member
you can try using the "Trim" function...
eg.
Dim MyString, TrimString
MyString = " <-Trim-> " ' Initialize string.
TrimString = Trim(MyString) ' TrimString = "<-Trim->".
-
Nov 29th, 2000, 04:08 AM
#3
Frenzied Member
exactely...
and when you only want to remove spaces from the left- or right side of the string also check out LTrim (LeftTrim) and RTrim (RightTrim).
Jop - validweb.nl
Alcohol doesn't solve any problems, but then again, neither does milk.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|