This works if you can get your text into a variable.
You could even use a loop to replace repeating someof the codeVB Code:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim TheSentence As String TheSentence = "The red rabbit ran round the ragged rock2" Dim Word1 As String Dim Word2 As String Dim Word3 As String Dim strLen As Integer = Len(TheSentence) TheSentence.IndexOf(" ") Word1 = Left(TheSentence, TheSentence.IndexOf(" ")) Label1.Text = Word1 TheSentence = TheSentence.Remove(0, TheSentence.IndexOf(" ")) TheSentence = LTrim(TheSentence) Word2 = Left(TheSentence, TheSentence.IndexOf(" ")) Label2.Text = Word2 TheSentence = TheSentence.Remove(0, TheSentence.IndexOf(" ")) TheSentence = LTrim(TheSentence) Word3 = Left(TheSentence, TheSentence.IndexOf(" ")) Label3.Text = Word3 TheSentence = TheSentence.Remove(0, TheSentence.IndexOf(" ")) TheSentence = LTrim(TheSentence) Label4.Text = Word1 & Word2 & Word3 End Sub




Reply With Quote