[AccessD] Remove non-alphanumeric characters

Foote, Chris Chris.Foote at uk.thalesgroup.com
Tue Apr 13 01:52:26 CDT 2004


Thanks for comments Andy!

Looks a bit simpler than my solution - I'll give it a go.

Chris Foote (UK)

> -----Original Message-----
> From: Andy Lacey [mailto:andy at minstersystems.co.uk]
> Sent: Thursday, April 08, 2004 5:55 PM
> To: Access Developers discussion and problem solving
> Subject: Re: [AccessD] Remove non-alphanumeric characters
> 
> 
> Well personally I'd find it easier to read if you just 
> compared characters,
> so. Also, as long as your Option Compare doesn't cause case-sensitive
> comparisoins, you need only test for a-z once.
> 
> For intPos = 1 To Len(spAlphaNum)
> strChar = Mid(spAlphaNum, intPos, 1)
> Select Case strChar
> Case "0" To "9"   ' Numeric
> strClean = strClean + strChar
> Case "a" To "z"   ' Uppercase Alpha
> strClean = strClean + Ucase(strChar)
> Case Else
> End Select
> Next intPos
> 
> --
> Andy Lacey
> http://www.minstersystems.co.uk
> 
> 
> 
> --------- Original Message --------
> From: Access Developers discussion and problem solving
> <accessd at databaseadvisors.com>
> To: 'Access Developers discussion and problem solving'
> <accessd at databaseadvisors.com>
> Subject: [AccessD] Remove non-alphanumeric characters
> Date: 08/04/04 15:39
> 
> >
> > Good afternoon all!
> >
> > I have a requirement to strip a string of all 
> non-alphanumeric characters.
> > In addition I wanted to change all upper-case characters to 
> lower-case.



More information about the AccessD mailing list