Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Removing extra spaces in MIDDLE of str.
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00535205
Message ID:
00535756
Vues:
13
>>>>>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform