devxlogo

Get Letter Count

Get Letter Count

The following code returns the amount of times that a char appears in a stringPrivate Function GetLetterCount(ByVal input As String, ByVal letter As Char) As Integer Return input.ToCharArray().Count(Function(c) c = letter)End Function

devx-admin

Share the Post: