counting characters in a string 
Author Message
 counting characters in a string

Hi,
How can one count characters in a string? For example, there are three
characters in 436.
Thanks!
Andy


Sun, 01 Jul 2001 03:00:00 GMT  
 counting characters in a string

Quote:

> Hi,
> How can one count characters in a string? For example, there are three
> characters in 436.
> Thanks!
> Andy

Len(string)

Keri Hardwick



Sun, 01 Jul 2001 03:00:00 GMT  
 counting characters in a string
Hi Andy,
Try using the Len function:
    intLength = Len(strInput)
Cheers,
Mark Argent,
Waitakere City,
New Zealand.
Quote:

> Hi,
> How can one count characters in a string? For example, there are three
> characters in 436.
> Thanks!
> Andy



Mon, 02 Jul 2001 03:00:00 GMT  
 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.



Mon, 09 Jul 2001 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Counting Characters in a string

2. Count characters in a string

3. Count occurances of a character string?

4. Finding & Counting Certain Characters in a string

5. return the count of a particular character in a string

6. Count Upper Case characters in a string

7. Count Upper Case characters in a string

8. Search a string and change a character if it exists in the string

9. How can I replace an arbitrary character in a string (String functions in general)

10. running character count

11. Counting characters as they are typed

12. COUNT OF CHARACTERS IN A MAIL

 

 
Powered by phpBB® Forum Software