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:
00535756
Views:
14
>>>>>This will remove occurances of multiple spaces.
>>>Harumph! Can't FoxTools' REDUCE function do this?? I know I can do it with VBScript.RegExp:
>>>
>>>
oReg = CREATEOBJ('VBScript.RegExp')
>>>oReg.Global = .T.             && FOR ALL OCCURANCES
>>>oReg.Pattern = '\b[\t ]+\b'   && Match any occurance of one or more spaces/tabs
>>>cReducedString = oReg.Replace(cUnReducedString,' ') &&Replace match with ' '
>>
>>< g >Well, and unbeknownst to me, it looks like it can. I just tried:
lcstring = "John " + CHR(9) + " Smith"
>>? lcstring && Prints John       Smith
>>? Reduce(lcstring) && Prints John Smith
So apparently it can (at least in 6.0). Also placed multiple occrences of the tab and spaces between them and it still worked. **Braaaaaaaaaaaack**< sticks tongue out at Ed >:-)
>
>Hey, I'm not the one who's a member of the FoxTools and Dark Beer club...they're gonna take away yer beer for this for a week!

No! No! Anything but that!:-)
George

Ubi caritas et amor, deus ibi est
Previous
Reply
Map
View

Click here to load this message in the networking platform