Hey i am having trouble creating a piglatin converter using dynamic arrays in vb this is my code so far. the problem is i cant convert multiple words into piglatin
Private Sub insertWay(ByVal convertWord As String)
'function will add -way to the words that do not contain vouls
Const nonVoul As String = "-way"
outputTextBox.Text = convertWord & nonVoul
End Sub
Private Sub toPigLatinToolStripMenuItem_Click(sender As Object, e As System.EventArgs) Handles ToPigLatinToolStripMenuItem.Click
Dim Word As String
Word = inputTextBox.Text.Trim
If Word <> Nothing Then
If Word.ToString Like "[aeiou]*" Then
Call insertWay(Word)
Else
Call insertAy(Word)
End If
End If
inputTextBox.SelectAll()
End Sub
Private Sub insertAy(ByRef Word As String)
'searches the words to see if they contain vouls
Dim remainder As String = ""
Do Until Word = ""
remainder += Word(0)
Word = Word.Remove(0, 1)
If Word.ToLower Like "[aeiouy]*" Then
outputTextBox.Text = Word & "-" & remainder & "ay"
Exit Sub
End If
Loop
Call insertWay(remainder)
End Sub