Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Dim i As Integer Dim LetterCount As String = 0 Dim strText As String Dim letter As Char strText = "Debugging" For i = 1 To strText.Length + 1 letter = strText.Substring(0) If letter = "g" Then LetterCount = LetterCount + 1 End If Next rt1.Text = "G appears" & LetterCount & "times" End Sub