Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Case insensitive strtran()
Message
From
26/04/2001 13:58:22
 
 
To
25/04/2001 15:04:56
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00499747
Message ID:
00500272
Views:
63
I can't do the 'first' because it will change the case of the existing string. The vb idea is interesting, but I would rather stay all VFP with this one.



>>Hi All,
>>
>>Has anyone written a case insensitive STRTRAN() replacement.
>>
>>NO, I can't just use VFP 7!
>>
>>BOb
>
>You mean to replace, e.g., "VALUE" or "value"
>or
>"VALUE" or "Value" or "vAlUe", etc.?
>The first is easy
>lcReplace="Test"
>lcExpression="This is a test TEST"
>? Strtran(Strtran(lcExpression, Lower(lcReplace), lcReplace), Upper(lcReplace), lcReplace)
>You could use a VB object to do this.
>e.g., create a VB ActiveX dll and a class called whatever you like (mine is VBStuff.VBFunctions)
>add this method
>Function StrTranC(ByVal cExpression As String, _
>        ByVal cFind As String, _
>        ByVal cReplace As String) As String
>
>    StrTranC = Replace(cExpression, cFind, cReplace, , , vbTextCompare)
>
>End Function
>
>In VFP, call it like this:
>ox=CreateObject("VBStuff.VBFunctions")
>? ox.StrTranC("This is a tEsT", "test", "Test")
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform