str="KAMESWARARAO"
counter=0
For i=1 to len(str)
strChar=mid(str,i,1)
If strChar="A" Then
counter=counter+1
End If
Next
msgbox counter
===========Second Method========
msgbox Len(str)-Len(Replace(str,"A",""))
counter=0
For i=1 to len(str)
strChar=mid(str,i,1)
If strChar="A" Then
counter=counter+1
End If
Next
msgbox counter
===========Second Method========
msgbox Len(str)-Len(Replace(str,"A",""))
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.