Get the amount of a specific character in a string
If you have completed an application and wish to share the complete source/project files with everyone then please post it in here. Source-code files only, no tutorials.
this code gets the amount of a specific character in a string
e.g.
CharCount("Apple", "p") will return 2
e.g.
CharCount("Apple", "p") will return 2
Code: Select all
Function CharCount(ByVal iStr As String, ByVal iChar As String)
Dim iCount As Integer = 0
For i = 0 To iStr.Length - 1
If iStr.Chars(i) = iChar Then iCount += 1
Next
Return iCount
End Function
Cheatmasterbw wrote:where??sorry i didn't read wright now i've seen that 1 tut is about the amount of a character in a string an the other is about the most common character in a string.
I'm Sorry
You can find me on Facebook or on Skype mihai_92b
thanks Cheatmaster 
cooll;

cooll;
Nailing my feet to the floor is easier than using my own muscles to balance, but you don't see me doing that 

This works but should be in quick snips
zachman: your welcome
Lewis-Froom: i think this is source code in a way.
Lewis-Froom: i think this is source code in a way.
cool i always wanted to know it, but havent got the time to ask if any1 had it xD Thanks for sharing Cheatmasterbw cooll;
Copyright Information
Copyright © Codenstuff.com 2020 - 2023