Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Removing extra spaces in MIDDLE of str.
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00535205
Message ID:
00535684
Views:
17
Thanks. I have been wondering about that for a long time.


>>This will remove occurances of multiple spaces.
>>
>>lcStr = ALLTRIM(lcOriginalStr) && remove leading and trailing spaces
>>DO WHILE AT(" ", lcStr) > 0 && look for double space
>> lcStr = STRTRAN(lcStr, " ", " ", 1, 1) && convert double space to single
>>ENDDO
>>
>>I do not know how to get UT to not remove spaces.
>>
>Use < PRE > and < /PRE > tags like this:
lcStr = ALLTRIM(lcOriginalStr)    && remove leading and trailing spaces
>DO WHILE AT("  ", lcStr) > 0       && look for double space
>   lcStr = STRTRAN(lcStr, "  ", " ", 1, 1)  && convert double space to single
>ENDDO
If you hit the reply button, you'll see the actual tags.
Dennis Lindeman
Previous
Reply
Map
View

Click here to load this message in the networking platform