CodeItBetter Programming Another VB Programming Blog

How to Strip Alphabets from a string

Posted on January 4, 2009
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
'String Manipulation - How to Strip Alphabets from a string
Option Explicit
 
Public Function StripAlpha(ByVal strExpression As String) As String
    Dim iLength As Integer, I As Integer
    Dim sResult As String, sChar As String
    iLength = Len(strExpression)
    For I = 1 To iLength
        sChar = Mid$(strExpression, I, 1)
        If Not sChar Like "[A-Za-z]" Then
            sResult = sResult & sChar
        End If
    Next I
    StripAlpha = sResult
End Function
Comments (0) Trackbacks (0)

No comments yet.


Leave a comment


 

No trackbacks yet.