Click to See Complete Forum and Search --> : Simple dumb string question


September 24th, 1999, 02:31 AM
I have a string that will always be 75 spaces then a url, i.e.
"(insert 75 spaces here)www.hotmail.com"
My question is how can i take those spaces out without refuring to the url, since it will be different everytime and may or may not have http:// or www. ?
Thanks in Advance.
Ele

Chris Eastwood
September 24th, 1999, 02:51 AM
Hi

How about something like :


'
' sUrl is your string with 75 spaces then a Url
'
Dim sTemp as string

If len(sUrl) > 75 then
sTemp = Right$(sUrl, len(sUrl) - 75)
sUrl = sTemp
End If






Chris Eastwood

CodeGuru - the website for developers
http://codeguru.developer.com/vb

Manmath Nath Das
September 24th, 1999, 05:32 AM
Hi!
I think the solution given by Chris Eastwood is ok, still one more solution
to this ,is to use ltrim(sting name), which will clear all the left
whitespaces swithout disturbing the url.
thanks.
manmath

StevenH
September 24th, 1999, 05:59 AM
If your trying to strip all of the spaces off of the left side of a string try the Ltrim$() function.

ranjit
September 24th, 1999, 07:34 AM
Wont Just Simple pain Trim(Str) work which can trim all the white spaces trailing and leading as well.