Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Filter out garbage characters
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Divers
Thread ID:
01269971
Message ID:
01269978
Vues:
13
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, [] ), [] )
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform