Re: RE: Trim

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Jimi (jimi_with_an_i_at_yahoo-dot-ca.no-spam.invalid)
Date: 05/07/04


Date: 7 May 2004 14:00:58 -0500


> Gary Miltonwrote:
Hi Michael,
>
> Try this...
>
> \\\
> Dim MyString As String = "one two three four five"
>
> Do While (MyString.IndexOf(" ") >= 0)
> MyString = MyString.Replace(" ", " ")
> Loop
> ///
>
> HTH,
> Gary

I believe the original question asked for any approach other than the
one you gave. I don't believe there is any way to solve this problem
more efficiently than an unknown number of replaces. (you could use
regular expressions, but my experience indicates that they would not
be nearly as efficient as the indicated loop).

I'd be curious to see if anyone has an alternative solution.



Relevant Pages

  • Re: Userform and Module
    ... >> you have a loop to me, the macro shows the form, which calls the macro, ... >> HTH ... >> Bob Phillips ... >> (remove nothere from email address if mailing direct) ...
    (microsoft.public.excel)
  • Re: [VFP 9] strange problem
    ... All in all you mislead us quite a bit, ... Per my original question, the bug only appeared when I set a control.enabled=m.xx. ... The loop is not related to my codes. ... Specialized in providing ePOS solutions ...
    (microsoft.public.fox.programmer.exchange)
  • Re: Do Until Help
    ... loop until row> 90 ... end sub ... HTH ... > Huge thanks for your suggestion, but I don't understand what you mean:( ...
    (microsoft.public.excel.programming)
  • Re: Step through a table
    ... With CurrentDb.OpenRecordset("MyTable", dbOpenDynaset) ... Do Until .EOF ' To step through all records ... Loop ... HTH ...
    (microsoft.public.access.modulesdaovba)
  • Re: Simple Array Looping
    ... > HTH ... > (remove nothere from the email address if mailing direct) ... >> having trouble figuring out how to loop through a list I define that will ... >> the next item in the array. ...
    (microsoft.public.excel.programming)