Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Matching parts of two Strings
Message
De
16/09/2002 17:50:39
 
 
À
16/09/2002 17:45:33
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00700976
Message ID:
00701001
Vues:
21
>
yourstring="123,456,abc"
STREXTRACT( yourstring, ",", "", 3)
>will extract "abc", the last field, in the above example
Sorry, I left out the occurance number, "3". Using my eye as a compiler has it's limits. Yes, you could say this is special case handling for the first and last fields. In the case of the last field you have to know how many fields there are.
Scott

[typo?] As a matter of fact, it won't (it will return 456,abc). But if, as was said in the update, a delimiter is inserted at the start of the string, STREXTRACT() can be generalized: STREXTRACT(","+yourstring,",",",",pairnumber,2).
----------------------------------
Scott Ramey
BDS Software
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform