Results 1 to 2 of 2

Thread: Remove Whitespace

  1. #1

    Thread Starter
    Frenzied Member SeanK's Avatar
    Join Date
    May 2002
    Location
    Boston MA
    Posts
    1,160

    Remove Whitespace

    How can I remove spaces from with in a string (Trim does not work here)

    Example:
    VB Code:
    1. sStr =    "Hello           My name    is        Sean"  'should be
    2. sStr = "Hello My name is Sean"
    Beantown Boy
    Please use [highlight=vb]your code goes in here[/highlight] tags when posting code.
    When you have received an answer to your question, please mark it as resolved using the Thread Tools menu.

  2. #2
    Frenzied Member
    Join Date
    Jul 2002
    Posts
    1,370
    Code:
    Do While instr(sStr,"  ")>0
       sStr = Replace(sStr,"  "," ")
    Loop

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