Hi everyone. im kinda bored so i made my own code language. the code is like a=e b=q c=m d=p e=i ect. so i made it into a program. so i started to fill in the code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim text As String
text = TextBox1.Text.Replace("A", "E").Replace("a", "e")
MsgBox(text & "!", MsgBoxStyle.OkOnly, "Replace String Example")
End Sub
and i typed in "Aa" and i got a msgbox that said "Ee!"
so then i started to type in more:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim text As String
text = TextBox1.Text.Replace("A", "E").Replace("a", "e").Replace("B", "Q").Replace("b", "q").Replace("C", "M").Replace("c", "m").Replace("D", "P").Replace("d", "p").Replace("E", "I").Replace("e", "i")
MsgBox(text & "!", MsgBoxStyle.OkOnly, "Replace String Example")
End Sub
i typed in "Trixie is a good cat" and got a msgbox that said "Trixii is i goop mit!" I know why it did this. for the word cat i was supposed 2 get "met" but got "mit". its because a changes to e but e changes to i. i want the code to replace the letter only once like a to e, and not to change twice like a to e e to i. can someone help me with that??? thx!