Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Locating and replacing a charcter in a field
Message
From
28/12/1999 14:44:23
 
 
To
28/12/1999 14:37:22
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00309380
Message ID:
00309390
Views:
26
Hi Sean,

>I have solved my many DB connectivity problems and was wondering what function I would use to locate a character in a field and replace it with something else ie make smith,charles smith charles or something like that. TIA

You have two choices, CHRTRAN() and STRTRAN().

Chrtran() is faster because it only does searches for one character:

lcText = chrtran('smith, charles', ',', '')

returns "smith charles". It also replaces every found occurenece:

lcText = chrtran('s,m,i,th, charles', ',', '')

also returns "smith charles"

Strtran() can find and replace whole strings with whole strings, look in the help for more info.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform