Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Strtran()
Message
From
06/08/2003 17:25:41
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Title:
Miscellaneous
Thread ID:
00817479
Message ID:
00817483
Views:
24
>Hi All:
> Is there a function that would search the string for multiple occurance of a variable and replace it with null?
>
>I.E. cString="abc,f;fdc"
>replace , and ; with 0. Thus the result will be "abc0f0fdc"
>I want to use function similar to Strtran(), but this search for one occurance of a letter.
>Thaks
>MA

IIRC, it will replace the entire string. But you need to use it twice, once for the ",", once for the ";".

This might be simpler with chrtran(). I don't have VFP handy, but I think it would be something similar to:

chrtran("abc,f;fdc", ",;", "00")

HTH,

Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Reply
Map
View

Click here to load this message in the networking platform