Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SUBSTR() by taking care of upper characters
Message
De
18/01/2003 23:32:03
 
 
À
18/01/2003 23:29:30
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00743063
Message ID:
00743218
Vues:
17
>Regular expressions can do this and much more.
>
>
>lcHtml = "But, it may well be that Michel would be found as MICHEL" + ;
>" and with a mix a case characters. So, is there a way with STRTRAN()" + ;
>" to handle that. What I am looking for is to have all kind of occurences" + ;
>" of Michel to be replaced by Michel Fournier. Even if MICHEL is uppercase" + ;
>" or other variations, I want it to be replaced Michel Fournier. Can " + ;
>"STRTRAN() do it or do I have to build a custom function for that?"
>
>? lcHtml
>
>loRegExp = CreateObject("VBScript.RegExp")	&& Create regular expression object
>loRegExp.Pattern = "michel"					&& Set the pattern
>loRegExp.Global = .t.
>loRegExp.IgnoreCase = .t.					&& Make case insensitive
>loRegExp.Multiline = .t.
>lcHtml = loRegExp.Replace(lcHtml, "Michel Fournier")	&& Make replacement.
>
>? lcHtml
>
It is good to know that we can achieve that by this approach as well.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform