Saturday, 30 July 2011

Get Character value and their count from a string


Dim str
dim inttemp

str = "7pankaj7868PANKAJ"
i=1
k=0
Do
            temp = mid(str,i,1)
If  temp="" Then
            Exit do
End If
ascii = asc(temp)
            If  (ascii >=97 and ascii <=122) or (ascii >=65 and ascii <=90)Then
                        k=k+1
inttemp = inttemp&temp
            End If

i=i+1
Loop
msgbox K
msgbox inttemp

1 comment: