Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Removing multiple blanks
Message
De
12/06/2007 11:28:16
 
 
À
11/06/2007 20:03:10
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
Divers
Thread ID:
01232128
Message ID:
01232299
Vues:
13
REDUCE() was what I was trying to remember.

Thanks.......Rich

>>I know there has to be a better way of doing this than
>>FUNCTION rem_mult_blanks(tcString)
>>DO WHILE "  " $ tcString
>>  tcString = STRTRAN(tcString,"  "," ")
>>ENDDO
>>
>>RETURN tcString
>>
>>but I can't seem to remember what it is.
>
>There's a Reduce() function in FoxTools.fll, or if you don't want to use that, you can just improve your algorithm:
>
>
>
>FUNCTION rem_mult_blanks(tcString)
>i=32
>lcSpace=space(i)
>do while i>1
>  DO WHILE lcSpace $ tcString
>    tcString = STRTRAN(tcString,lcSpace," ")
>  ENDDO
>  i=i/2
>  lcSpace=space(i)
>enddo
>RETURN tcString
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform