//************************************** // Name: Clean Unwanted Characters From a String // Description:Function to clean all characters but A-Z, a-z, and 0123456789. When I don't use Regular Expressions I use this function to put only the characters I want into a string. It is very useful for password generation. Look up the Dec number on an ASCII chart and use this for many things. // By: Tom Harris (from psc cd) // // // Inputs:The string you want to remove unwanted characters from // // Returns:A String with only A-Z, a-z, and 0-9 charactes // //Assumes:You will need an ASCII chart to look up the DEC values associated with the ASCII character if you want to modify the specific chars stripped. http://www.asciitable.com is a good resource. // //Side Effects:None //************************************** 'Function to clean all characters but A- // Z, a-z, and 0123456789 'When I don't use Regular Expressions I // use this function to put 'only the characters I want into a strin // g. It is very useful 'for password generation. Look up the De // c number on an ASCII // 'chart and use this for many things. Public Function CleanString(ByVal strDirty As String) As String Dim strLen As String Dim strCounter As Integer Dim strClean As String strLen = strDirty.Length strClean = "" For strCounter = 1 To strLen Select Case Asc(Mid(strDirty, strCounter, 1))    Case 65 To 90 'A-Z      strClean = strClean & Mid(strDirty, strCounter, 1)    Case 97 To 122 'a-z      strClean = strClean & Mid(strDirty, strCounter, 1)    Case 48 To 57 ' 0123456789      strClean = strClean & Mid(strDirty, strCounter, 1)    Case Else      'All other characters are stripped out End Select Next Return LCase(strClean) End Function