Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Class frmConverter
- Private Sub btnConvert_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnConvert.Click
- Dim word, position, cons, last As String
- Dim vow As Integer = 0
- word = txtInput.Text.ToLower()
- position = txtInput.Text.Substring(0, 1)
- If txtInput.Text.Length >= 3 Then
- If position = "a" Or position = "e" Or position = "i" Or position = "o" Or position = "u" Then
- txtOutput.Text = word & "way"
- ElseIf txtInput.Text.Contains("a") Then
- vow = txtInput.Text.IndexOf("a")
- cons = txtInput.Text.Substring(0, vow)
- last = txtInput.Text.Substring(vow)
- txtOutput.Text = last & cons & "ay"
- ElseIf txtInput.Text.Contains("e") Then
- vow = txtInput.Text.IndexOf("e")
- cons = txtInput.Text.Substring(0, vow)
- last = txtInput.Text.Substring(vow)
- txtOutput.Text = last & cons & "ay"
- ElseIf txtInput.Text.Contains("i") Then
- vow = txtInput.Text.IndexOf("i")
- cons = txtInput.Text.Substring(0, vow)
- last = txtInput.Text.Substring(vow)
- txtOutput.Text = last & cons & "ay"
- ElseIf txtInput.Text.Contains("o") Then
- vow = txtInput.Text.IndexOf("o")
- cons = txtInput.Text.Substring(0, vow)
- last = txtInput.Text.Substring(vow)
- txtOutput.Text = last & cons & "ay"
- ElseIf txtInput.Text.Contains("u") Then
- vow = txtInput.Text.IndexOf("u")
- cons = txtInput.Text.Substring(0, vow)
- last = txtInput.Text.Substring(vow)
- txtOutput.Text = last & cons & "ay"
- End If
- Else
- MessageBox.Show("word must be at least 3 letters long", "ERROR")
- End If
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement