Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is there a STRTRAN function which is not case sensitive
Message
 
To
30/04/2002 10:55:20
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00650635
Message ID:
00650976
Views:
34
Cetin,
Thanks for your help

Regards,

Gerard


>>is there a Strtran function (or similar) which will replace text but in a case insensitive manner, e,g,
>>
>>Abc=Strtran(MyFruit,'Apples','Coca Cola')
>>Abc=Strtran(MyFruit,'apples','Coca Cola')......
>>
>>otherwise I will need to put every possible combination of 'Apples' in using Upper and lower case
>>
>>I am using Strtran on a memo field, so it is not possible just to upper it first
>>
>>Regards,
>>
>>Gerard
>
>Yet another strtranc :)
>
>
>FUNCTION strtranc
>LPARAMETERS tcString, tcSearch, tcReplace
>tcSearch = upper(tcSearch)
>LOCAL lnOccurences,lnLen,ix
>lnOccurences = OCCURS(tcSearch, UPPER(tcString))
>IF lnOccurences=0
>	RETURN tcString
>ENDIF
>lnLen = LEN(tcSearch)
>FOR ix=1 TO lnOccurences
>	tcString = STUFF(m.tcString,ATC(m.tcSearch,m.tcString,m.ix),;
>		m.lnLen,m.tcSearch)
>ENDFOR
>RETURN STRTRAN(tcString, tcSearch, tcReplace)
>
Cetin
Previous
Reply
Map
View

Click here to load this message in the networking platform