How to get the capital letters and small letters count?
To get the capital letters and small letters count, use the following code.
str= "MadhaviAUTO"
For i=1 to len(str)
a=mid(str,i,1)
If ASC(a)>=65 AND ASC(a)<=90 Then
strRes=strRes &a
Else
strRes2=strRes2 &a
End If
Next
CapLen=len(strRes)
SmallLen=Len(strRes2)
msgbox "Your Result is- Caps : " &strRes &" - Small : "& strRes2
msgbox "Len of Caps : " & CapLen & "- Len of Small : " & SmallLen
str= "MadhaviAUTO"
For i=1 to len(str)
a=mid(str,i,1)
If ASC(a)>=65 AND ASC(a)<=90 Then
strRes=strRes &a
Else
strRes2=strRes2 &a
End If
Next
CapLen=len(strRes)
SmallLen=Len(strRes2)
msgbox "Your Result is- Caps : " &strRes &" - Small : "& strRes2
msgbox "Len of Caps : " & CapLen & "- Len of Small : " & SmallLen


Comments
Post a Comment