Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
String parsing
Message
 
 
À
06/10/1999 09:33:25
Charlie Schreiner
Myers and Stauffer Consulting
Topeka, Kansas, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00273042
Message ID:
00274026
Vues:
45
Charlie,


>Here's another technique for parsing strings.
>
>Replace the commas with CHR(13) using STRTRAN.
>String = STRTRAN(m.String,',', CHR(13))
>Now put each element in an array.
>ALINES(aStrings, m.String)
>FOR EACH String IN aStrings
>   * Do something with each m.String.
>ENDFOR
>

It's interesting but not universal enough. What we can do if we have 2 commas ,(for example: "I,,the,12,etc.,," there a comma is an isolate case of a delimiter? We don't want to have additional empty members of array.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform