![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
|
All, Is there such a function that can strip all non alpha ( not between a-z) characters from a string? I have a function that I currently use that will strip one character at a time from a string that I tried tweaking without success. Any help would be much appreciated. Thanks in advance, Mark C. hereinde (AT) yahoo (DOT) com |
#2
| |||
| |||
|
|
All, Is there such a function that can strip all non alpha ( not between a-z) characters from a string? I have a function that I currently use that will strip one character at a time from a string that I tried tweaking without success. Any help would be much appreciated. Thanks in advance, Mark C. hereinde (AT) yahoo (DOT) com |
#3
| |||
| |||
|
#4
| |||
| |||
|
|
Oops -- Sorry, I misread your post. This will strip numeric characters from the string. If you want to cover other alpha characters, such as French or German alpha characters, you can modify the For loop parameters as needed. Full "width" of ASCII characters is 0 to 255 for Chr(x) function (x = 0 to 255). Function StripNumberChars(strOriginalString As String) As String Dim intLoop As Integer Dim strTemp As String On Error Resume Next strTemp = strOriginalString For intLoop = Asc("0") To Asc("9") strTemp = Replace(strTemp, Chr(intLoop), "", 1, -1, vbTextCompare) Next intLoop StripNumberChars = strTemp Err.Clear End Function "Mark C" <hereinde (AT) yahoo (DOT) com> wrote in message news:4dadnSgH-t__b53cRVn-jA (AT) comcast (DOT) com... All, Is there such a function that can strip all non alpha ( not between a-z) characters from a string? I have a function that I currently use that will strip one character at a time from a string that I tried tweaking without success. Any help would be much appreciated. Thanks in advance, Mark C. hereinde (AT) yahoo (DOT) com |
#5
| |||
| |||
|
|
Thanks ken, The function worked perfectly. Regards, Mark C. hereinde (AT) yahoo (DOT) com "Ken Snell" <kthsneisllis9 (AT) ncoomcastt (DOT) renaetl> wrote in message news:upsTuWLcEHA.1596 (AT) TK2MSFTNGP09 (DOT) phx.gbl... Oops -- Sorry, I misread your post. This will strip numeric characters from the string. If you want to cover other alpha characters, such as French or German alpha characters, you can modify the For loop parameters as needed. Full "width" of ASCII characters is 0 to 255 for Chr(x) function (x = 0 to 255). Function StripNumberChars(strOriginalString As String) As String Dim intLoop As Integer Dim strTemp As String On Error Resume Next strTemp = strOriginalString For intLoop = Asc("0") To Asc("9") strTemp = Replace(strTemp, Chr(intLoop), "", 1, -1, vbTextCompare) Next intLoop StripNumberChars = strTemp Err.Clear End Function "Mark C" <hereinde (AT) yahoo (DOT) com> wrote in message news:4dadnSgH-t__b53cRVn-jA (AT) comcast (DOT) com... All, Is there such a function that can strip all non alpha ( not between a-z) characters from a string? I have a function that I currently use that will strip one character at a time from a string that I tried tweaking without success. Any help would be much appreciated. Thanks in advance, Mark C. hereinde (AT) yahoo (DOT) com |
#6
| |||
| |||
|
|
Oops -- Sorry, I misread your post. This will strip numeric characters from the string. If you want to cover other alpha characters, such as French or German alpha characters, you can modify the For loop parameters as needed. Full "width" of ASCII characters is 0 to 255 for Chr(x) function (x = 0 to 255). Function StripNumberChars(strOriginalString As String) As String Dim intLoop As Integer Dim strTemp As String On Error Resume Next strTemp = strOriginalString For intLoop = Asc("0") To Asc("9") strTemp = Replace(strTemp, Chr(intLoop), "", 1, -1, vbTextCompare) Next intLoop StripNumberChars = strTemp Err.Clear End Function "Mark C" <hereinde (AT) yahoo (DOT) com> wrote in message news:4dadnSgH-t__b53cRVn-jA (AT) comcast (DOT) com... All, Is there such a function that can strip all non alpha ( not between a-z) characters from a string? I have a function that I currently use that will strip one character at a time from a string that I tried tweaking without success. Any help would be much appreciated. Thanks in advance, Mark C. hereinde (AT) yahoo (DOT) com |
#7
| |||
| |||
|
|
"Mark C" <hereinde (AT) yahoo (DOT) com> wrote in message news:4dadnSgH-t__b53cRVn-jA (AT) comcast (DOT) com... All, Is there such a function that can strip all non alpha ( not between a-z) |
|
characters from a string? I have a function that I currently use that will strip one character at a time from a string that I tried tweaking without success. Any help would be much appreciated. Thanks in advance, Mark C. hereinde (AT) yahoo (DOT) com |
![]() |
| Thread Tools | |
| Display Modes | |
| |