Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Finding an exact match in a string
Message
De
29/10/2019 13:05:56
 
 
À
27/10/2019 23:58:22
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01671709
Message ID:
01671737
Vues:
81
Thanks, Al - that was the easiest solution!!

>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...

If you want to eliminate this problem at the source, you could rename your variables to Var01, Var02, ...
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform