Foote, Chris
Chris.Foote at uk.thalesgroup.com
Tue Apr 13 09:01:18 CDT 2004
Thanks for that Gustav! An interesting different approach. Luckily (for me) my strings are never longer than about 15 characters. Thanks again! Chris Foote - UK > -----Original Message----- > From: Gustav Brock [mailto:gustav at cactus.dk] > Sent: Tuesday, April 13, 2004 1:50 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Remove non-alphanumeric characters > > > Hi Chris > > > 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. I > > could not find any ready-rolled solution so I've come up > with the code > > below. > > > Can anyone think of a more simple way of doing this? > > I don't think so. However, if you are about to handle large strings, > the appending method will prove very slow. If this is the case, you > could use Mid() as in the function below which trims a string for > anything else than numerals - you will be able to cut it down and > modify it for your purpose quite easily. > > /gustav > > <code> > > Function TrimNumString( _ > ByVal strNumString As String, _ > Optional ByVal strDecimalChr As String, _ > Optional ByVal booAcceptMinus As Boolean) _ > As String --------------(snip)-----------