Clean Unwanted Characters From a String
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.
AI
ملخص الذكاء الاصطناعي: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.
كود المصدر
'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. 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
التعليقات الأصلية (3)
مسترجع من Wayback Machine