
counting characters in a string
The number of characters in a string is returned by the Len() function.
If you need to count the number of times a character occurs in a string:
----------------------------------------
Function CharsInString(strIn As String, strChar As String) As Integer
Dim iPos As Integer
Dim iKt As Integer
Do
iPos = InStr(iPos + 1, strIn, strChar)
If iPos = 0 Then
Exit Do
Else
iKt = iKt + 1
End If
Loop
CharsInString = iKt
End Function
----------------------------------------
Quote:
> How can one count characters in a string? For example, there are three
> characters in 436.