Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Case insensitive strtran()
Message
From
26/04/2001 14:10:10
 
 
To
26/04/2001 13:58:22
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00499747
Message ID:
00500279
Views:
47
>>>
>>>Has anyone written a case insensitive STRTRAN() replacement.
>>>

This simple approach ignores the starting position and number of occurances but it gets the job done for most instances.
function mystrtran
lparameters lcTarget, lcSearchFor, lcReplaceWith

*-- lower case search param
tcLower = lower(lcSearchFor)
*-- upper case search param
tcUpper = upper(lcSearchFor)

tcResult1 = strtran(lcTarget, tcLower, tcReplaceWith)
tcFinalResult = strtran(lcResult1, tcUpper, tcReplaceWith)

return lcFinalResult
-Henry-
Previous
Reply
Map
View

Click here to load this message in the networking platform