1

textbox1 の文字列を使用して 3 番目の 'e' を探し、そのインデックスを伝えようとしています。たとえば、誰かがチーズと入力した場合、そのインデックス

これまでのところ、私は持っています

Dim word As String = TextBox2.Text
Dim x As String
Dim counter As Integer
Dim Letter As String
Dim word1 As String
x = 0
word1 = word.ToLower()
Do
    If word1.Substring(x, 1) = "e" Then counter = counter + 1 And x = x + 1
Loop Until counter = 3 Or counter <> 3
If counter <> 3 Then MsgBox("There are only " & counter & "e's in the inputted string") Else ListBox2.Items.Add(Letter)
4

0 に答える 0