Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Remove excessive spaces in string
Message
From
28/07/2009 15:45:59
Dragan Nedeljkovich
Now officially retired
Zrenjanin, Serbia
 
 
To
27/07/2009 13:39:24
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01414370
Message ID:
01415158
Views:
50
>So, it's possible to reduce series of spaces (or any other characters) down to 1 with a fixed number of STRTRAN() calls:
>
>- up to and including 4,096 spaces with 7 STRTRAN() calls
>- up to and including 1,048,576 spaces with 9 STRTRAN() calls

I've always done this by

do while "{2**n spaces}"$string
string=strtran(...)
enddo

But now... if the limit to reduce() is 64K, I'd chop the string into pieces smaller than that, and reassemble the results. Should be faster than going it all in Fox.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform