Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Filter out garbage characters
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01269971
Message ID:
01269978
Views:
12
This message has been marked as a message which has helped to the initial question of the thread.
I want to remove anything that isn't alphabetic, numeric, a space, hyphen, CR, LF, or an apostrophe. Being able to specify an ASCII range for deletion would be my ideal solution.

Off the tp of my head and untested:
lcGoodChars = [ '-0123456789] + CHR( 10 ) + CHR( 13 )
*** Upper case letters
FOR lnI = 65 TO  90
  lcGoodChars = lcGoodChars + CHR( lnI )
ENDFOR
*** Lower case letters
FOR lnI = 97 TO 122
  lcGoodChars = lcGoodChars + CHR( lnI )
ENDFOR
lcCleanString = CHRTRAN( lcString2Clean, CHRTRAN( lcString2Clean, lcGoodChars, [] ), [] )
Previous
Reply
Map
View

Click here to load this message in the networking platform