Hi,Below is my program to replace the string A to Z, B to Y .. . ..... Z to A and so on
PrivateSub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.ClickDim sample As Stringsample = TextBox1.TextDim letter As String = "AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz"Dim letter1 As String = "ZzYyXxWwVvUuTtSsRrQqPpOoNnMmLlKkJjIiHhGgFfEeDdCcBbAa" For Each s As String In sampleDim i As Integer For i = 0 To letter.Length - 1 If s = letter(i) Then TextBox2.Text += letter1(i) End If NextNext End Sub
Here i want the program, that should have only one for loop and inside the loop should not use the if conditions. Need the optimized code. Can anyone help me please