If i had a string like "3465-564576-3456-6"

and i wanted all the dashes removed, how would you do that in foxpro?

Re: removeing char from string by Rush

Rush
Tue Dec 30 10:04:43 CST 2003

Use STRTRAN() or CHRTRAN():

cTrimmed = STRTRAN("3465-564576-3456-6", "-")
cTrimmed = CHRTRAN("3465-564576-3456-6", "-", "")

- Rush

"Brian Henry" <bhenry@reschini.com> wrote in message
news:%23RpOqzuzDHA.1668@TK2MSFTNGP10.phx.gbl...
> If i had a string like "3465-564576-3456-6"
>
> and i wanted all the dashes removed, how would you do that in foxpro?
>
>



Re: removeing char from string by John

John
Tue Dec 30 10:29:06 CST 2003

Hey Brian,

To add to Rush' post, if you needed to remove anything except for a certain
set of characters:

WorkString = "12.34/56?78:90ABCDE"
CharsToKeep = "1234567890" && Only interested in digits
?CHRTRAN( WorkString, CHRTRAN( WorkString, CharsToKeep, "" ), "" )

- John

"Brian Henry" <bhenry@reschini.com> wrote in message
news:#RpOqzuzDHA.1668@TK2MSFTNGP10.phx.gbl...
> If i had a string like "3465-564576-3456-6"
>
> and i wanted all the dashes removed, how would you do that in foxpro?
>
>



Re: removeing char from string by Rush

Rush
Tue Dec 30 10:35:04 CST 2003

And to add to John's post, here's a nice article on using strings in Fox:

http://www.stevenblack.com/text.asp

- Rush

"John Spiegel" <jspiegel@YETANOTHERSPAMHATERc-comld.com> wrote in message
news:OSCMFEvzDHA.536@tk2msftngp13.phx.gbl...
> Hey Brian,
>
> To add to Rush' post, if you needed to remove anything except for a
certain
> set of characters:
>
> WorkString = "12.34/56?78:90ABCDE"
> CharsToKeep = "1234567890" && Only interested in digits
> ?CHRTRAN( WorkString, CHRTRAN( WorkString, CharsToKeep, "" ), "" )
>
> - John
>
> "Brian Henry" <bhenry@reschini.com> wrote in message
> news:#RpOqzuzDHA.1668@TK2MSFTNGP10.phx.gbl...
> > If i had a string like "3465-564576-3456-6"
> >
> > and i wanted all the dashes removed, how would you do that in foxpro?
> >
> >
>
>



Re: removeing char from string by Leemi

Leemi
Tue Dec 30 10:43:42 CST 2003

Hi Brian:

Here is an article on the topic that may help as well:

120098 INFO: Two Ways to Search & Remove Characters from a Text String
http://support.microsoft.com/?id=120098

I hope this helps and have a Happy New Year!

This posting is provided "AS IS" with no warranties, and confers no rights.

Sincerely,
Microsoft FoxPro Technical Support
Lee Mitchell

*-- VFP8 HAS ARRIVED!! --*
Read about all the new features of VFP8 here:
http://www.universalthread.com/VisualFoxPro/News/VFP8Release.asp
Purchase VFP8 here:
http://shop.microsoft.com/Referral/Productinfo.asp?siteID=11518

Keep an eye on the product lifecycle for Visual FoxPro here:
http://support.microsoft.com/default.aspx?id=fh;[ln];lifeprodv
- VFP5 Mainstream Support retired June 30th, 2003
- VFP6 Mainstream Support retires Sept. 30th, 2003


>And to add to John's post, here's a nice article on using strings in Fox:

> http://www.stevenblack.com/text.asp

> - Rush

>"John Spiegel" <jspiegel@YETANOTHERSPAMHATERc-comld.com> wrote in message
>news:OSCMFEvzDHA.536@tk2msftngp13.phx.gbl...
> Hey Brian,
>
> To add to Rush' post, if you needed to remove anything except for a
certain
> set of characters:
>
> WorkString = "12.34/56?78:90ABCDE"
> CharsToKeep = "1234567890" && Only interested in digits
> ?CHRTRAN( WorkString, CHRTRAN( WorkString, CharsToKeep, "" ), "" )
>
> - John
>
> "Brian Henry" <bhenry@reschini.com> wrote in message
> news:#RpOqzuzDHA.1668@TK2MSFTNGP10.phx.gbl...
> > If i had a string like "3465-564576-3456-6"
> >
> > and i wanted all the dashes removed, how would you do that in foxpro?