CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Guest

    Simple dumb string question

    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



  2. #2
    Join Date
    May 1999
    Location
    Oxford UK
    Posts
    1,459

    Re: Simple dumb string question

    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

  3. #3
    Join Date
    Sep 1999
    Posts
    1

    Re: Simple dumb string question

    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




  4. #4
    Join Date
    Sep 1999
    Posts
    2

    Re: Simple dumb string question

    If your trying to strip all of the spaces off of the left side of a string try the Ltrim$() function.



  5. #5
    Join Date
    Jun 1999
    Location
    Pune, Maharastra, India
    Posts
    59

    Re: Simple dumb string question

    Wont Just Simple pain Trim(Str) work which can trim all the white spaces trailing and leading as well.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured