Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do you extract parts of a string in a field?
Message
De
21/12/2000 09:46:20
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00455835
Message ID:
00455875
Vues:
25
>>Hi All! How do you extract certain parts of a string. Like I want to replace the first three digits of a field with something. ie. 50-1020 with 95-1020
>>Anything that begins with 50- I want to replace it with 95-
>>
>>Thanks in advance for your help!
>>
>>Joe
>
>Joe: You can use
>
>
>REPLACE MyField WITH "95-" + SUBS(MyField,4)
>
>
>or also you can use
>
>
>REPLACE MyField WITH STRTRAN(MyField, "50-", "95-")
>
>
>Selects the sentence that but to you agrees

REPLACE MyField WITH STRTRAN(MyField, "50-", "95-")
Luis,
This code will REPLACE all occurences of "50-" not just at the beginnig of the field.
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform