Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
STRTRAN not matter the case sensitive
Message
De
25/09/1997 16:14:31
 
 
À
25/09/1997 15:56:20
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00051652
Message ID:
00051657
Vues:
42
>I have a situation where I am using STRTRAN to replace some text in a memo field. It goes like this:
>
>REPLACE mymemo WITH STRTRAN(mymemo,'my text','new text')
>
>But, sometimes, in the memo field, the text that need to replaced is either lower case, upper case or a mix of both.
>
>If I use something like this:
>
>REPLACE mymemo WITH STRTRAN(UPPER(mymemo),'MY TEXT','new text')
>
>it will replace all the variations of my text but will also replace the memo field in uppercase. How, can I get all the variations by keeping the memo field as is?

You could call strtran twice:
REPLACE mymemo WITH STRTRAN(mymemo,'my text','new text')
REPLACE mymemo WITH STRTRAN(mymemo,UPPER('my text'),'new text')
but for case of mixed case you should write custom function/procedure/method.
Edward Pikman
Independent Consultant
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform