Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim sentence As String
sentence = "The rain in Spain falls mainly on the ground"
Dim startpos, spacepos, wordlen As Integer
startpos = 0
spacepos = sentence.IndexOf(" ", startpos)
wordlen = spacepos - startpos
Debug.Print(sentence.Substring(startpos, wordlen))
startpos = spacepos + 1
End Sub
End Class
Monday, March 1, 2010
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment