Text Analysis – Count Uppercase Letters
Counts the number of uppercase letters in a given string.
The function iterates through each character and increments the count for each uppercase letter.
VB
Public Function CountUppercaseLetters(ByVal input As String) As Integer
If String.IsNullOrEmpty(input) Then
Return 0
End If
Dim count As Integer = 0
For Each c As Char In input
If Char.IsUpper(c) Then
count += 1
End If
Next
Return count
End Function