Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem with removing something from string
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00469416
Message ID:
00470538
Vues:
45
>>>Hi everyone,
>>>
>>>I have this problem: my application returns a string which is form of where condition, e.g.
>>>
>>>"SiteMstr.ccode='01' and inslist(TranMstr.Lender,code1, code2) and etc."
>>>
>>>We're going to implement Data Warehouse algorithm, and therefore, I want to exclude all references to Table aliases from this string. The tables are limited to just three (may be four):
>>>SiteMstr
>>>TranMstr
>>>PropMstr
>>>
>>>My problem is that I don't know, how did I spell it, e.g. it could be:
>>>Sitemstr
>>>SITEMSTR
>>>SiteMStr
>>>etc.
>>>
>>>Of course, since it's my application, I can go through the form code, and use just one name convention everywhere, like "SiteMstr", but I'd like to know, perhaps there is more elegant solution.
>>>
>>>I guess, RegExp should help me here, but I don't know, how to use it in this case.
>>>
>>>Thanks a lot in advance.
>>

>>Why not simply update the string to uppercase?
>>Then you have no problem with the case
>
>What if I have coded values in lower or proper case? As I said, this string is a where condition. I don't want to change its casing.
>
>Anyway, thanks for your input.


Sorry for responding so late, but i haven't had any time to look at the UT.
(and haven't read all the new messages yet)
But if you want to hold the case, you can create a copy of the string converted to uppercase. Then search for the string SITEMSTR there with at etc. Then you can remove that word from the original string. (You know the position now)
The best you work from the end of the string to the beginning, cause if the string you are replacing has a different lenght, then you can have problems with working from the beginning to the end of the string.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform