Dim nameWithThreeVowels As String = "aeixyz"
Dim numberOfVowels As Integer = 0
Dim vowelsFound As String = ""
' loop through each character 'c'
For cIndex As Integer = 0 To nameWithThreeVowels.Length - 1
Dim c As String = nameWithThreeVowels(cIndex) 'get the letter at the specified position
If vowels.Contains(c) Then
numberOfVowels +=1
vowelsFound &= c & ","
End If
Next
' remove the last comma so you don't end up with '1,2,3,' for example
If Not vowelsFound = "" Then
vowelsFound = vowelsFound.Substring(0, vowelsFound.Length - 2)
End If
If numberOfVowels = 3 Then
MsgBox("3 vowels found: " & vowelsFound)
End If