Possible Duplicate:
Count specific character occurances in string
I have a delimeter in string that i have to validate. How can I count occurrences of that char. For now i have a next function.
Private Shared Function CountChars(ByVal value As String) As Integer
Dim count = 0
For Each c As Char In value
If c = "$"c Then
count += 1
End If
Next
Return count
End Function
Any alternative solution that looks better?