Public Class Form1
Private Sub btnTokenize_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTokenize.Click
Dim Sentence As String
Sentence = TextBox1.Text & " "
'Dim startPos, spacePos, wordLen As Integer
'Dim word As String
'startPos = 0
'spacePos = Sentence.IndexOf(" ", startPos)
'wordLen = spacePos - startPos
'word = Sentence.Substring(startPos, wordLen)
'lstOutput.Items.Add(word)
'startPos = spacePos + 1
'Dim midterm1, final1 As Integer
'Dim midterm2, final2 As Integer
'Dim midterm3, final3 As Integer
'Dim midterm4, final4 As Integer
'Dim midterm(3) As Integer
'Dim final(3) As Integer
'Dim mid_avg As Integer
'Dim total As Integer
'For Each x In midterm
' total = total + x
'Next
'mid_avg = total / (UBound(midterm) + 1)
Dim words() As String = Sentence.Split(" ")
For Each x In words
lstOutput.Items.Add(x)
Next
End Sub
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
btnTokenize.Focus()
End Sub
End Class
No comments:
Post a Comment