Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What is the best way to remove ( and - from phone number
Message
From
07/04/2005 16:38:01
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 6 SP5
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
00998428
Message ID:
01002417
Views:
22
>Maybe not BEST, but easy:
>* Replace with blanks
>aa = "(111) 111-111"
>aa = chrtran(aa,"("," ")
>aa = chrtran(aa,")"," ")
>aa = chrtran(aa,"-"," ")
>? aa
>* Eliminate
>aa = "(111) 111-111"
>aa = chrtran(aa,"(","")
>aa = chrtran(aa,")","")
>aa = chrtran(aa,"-","")
>aa = chrtran(aa," ","")
>? aa

You don't need separate CHRTRAN() commands, you can combine all the characters to be replaced into the one parameter:
aa = CHRTRAN(aa,"()-"," ")
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Previous
Reply
Map
View

Click here to load this message in the networking platform