Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Finding an exact match in a string
Message
 
 
À
27/10/2019 18:52:53
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01671709
Message ID:
01671711
Vues:
53
I would use first ALINES() to split the string and second ALINES() to split var name and value

>I am trying to find vars and their values in a string, and am having a hassle with similar var names. The vars are not all constantly in the string - in other words, it's a mixture of the vars, and I have to test to see what vars are in the particular string.
>
>If the string has Var1 and Var10 in it, and I test using $, I get a hit on both, but in the example string below, only Var10 is there
>
>VarString= "Var2=cd, Var3=ef, Var4=gh, Var5=ij, Var6=kl, Var7=mn, Var8=op, Var9=qr, Var10=st"
>
>If I use TestVar $ VarString and in that string it has Var10, for example, I will get a hit when testing for TestVar="Var10" as well as when TestVar="Var1".
>
>How do I eliminate this ambiguity?
>
>I hope I explained that clearly enough...
>
>Many thanks!
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform