Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Removing extra spaces and limiting input to A-Z, 1-0, an
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01159441
Message ID:
01159906
Views:
15
>>1. remvoe extra spaces between words, i.e. "xxx yyy" becomes "xxx yyy" and
>>that the input is only A-Z and 0-9 (i.e. no specail characters)
>
>Use reduce function from foxtools.fll, e.g.
>set library to foxtools.fll
>myString = reduce(m.myString)

Thanks, Naomi, I was wondering how long it would take someone to remember this. :-)

>>2. the input hast the format "xxx.yyy.ccc.etc) where "xxx", "yyy", "ccc", etc can only
>>A-Z, 0-9, last character cannot be a period, and first character of "xxx", "yyy", "ccc",
>>etc is A-Z.

Download Craig Boyd's RegExp.FLL from http://www.sweetpotatosoftware.com/SPSBlog/PermaLink,guid,9a28ad22-b41b-434a-a540-40e6197a099e.aspx and do something like the following:
lcUpper = "\u"         && or "[A-Z]" -- same difference
lcAlphaNum = "[\u\d]"  && or "[A-Z0-9]" -- see above
lcGroup = lcUpper + lcAlphaNum + lcAlphaNum
lcRegExp = "("+lcGroup+".)*" + lcGroup
? RegExp("ABC", lcRegExp)
? RegExp("ABC.", lcRegExp)
? RegExp("A1C.B2E", lcRegExp)
? RegExp("A1C.B2E.", lcRegExp)
? RegExp("A1C.B2E.A1C.B2E.A1C.B2E.A1C.B2E.A1C.B2E.000", lcRegExp)
? RegExp("A1C.B2E.A1C.B2E.A1C.B2E.A1C.B2E.A1C.B2E.A00", lcRegExp)
My blog
My consulting page
My home page

Member of the Trim Your Auto-Quote Campaign!
What's another word for thesaurus?
Previous
Reply
Map
View

Click here to load this message in the networking platform