vb.net - how to create a string using individual characters in visual basic? -
i'm trying create translator programme every letter of english language alphabet display made alphabet.
for instance when write "a" program. programme display "akh", , if write "b" display "bil". when write "ab" or "ba" write 1 of two. how can code displays both in order give english language characters
this code:
public class form1 private sub button1_click(sender object, e eventargs) end sub private sub textbox2_textchanged(sender object, e eventargs) handles textbox2.textchanged end sub private sub textbox3_textchanged(sender object, e eventargs) handles textbox3.textchanged end sub private sub button2_click(sender object, e eventargs) handles button2.click dim cerilian string = nil dim englishtext string = nil englishtext = inputbox("enter english language text") if englishtext.contains("a") cerilian = "akh" end if if englishtext.contains("b") cerilian = "bil" end if textbox2.text = cerilian end sub end class
try this:
private map new dictionary(of char, string)() _ { _ { "a"c, "akh" }, _ { "b"c, "bil" } _ ' etc } private sub button2_click(sender object, e eventargs) handles button2.click dim englishtext string = inputbox("enter english language text") textbox2.text = string.join("", _ englishtext.tochararray().select(function (x) map(x))) end sub
vb.net
No comments:
Post a Comment