Question

Is there another way to turn an 'a' into a 'Z' in the output textbox ?? because i want to make a Encrypting Software. And i dont want to freeze my application.

In my form i have an Input/Output textbox and 1 button.

I know you can do it with this code:

Output.text = Input.text.Replace("a","Z")

but is there another way to do this?

Was it helpful?

Solution

Well i think that there is not a shorter way but Replacing it like you did in your code.

When you want to run this code with a button click or when form loads or is shown. Then its smarter to Put it into a Private sub. Or put your Code into a BackgroundWorker.

so you dont have to paste your code everywhere where you want it to run.

Private Sub Encrypt()
Dim Text as string = Input.text
Text = Text.replace("a","z")
Text = Text.replace("b","y")
Text = Text.replace("c","x")
Text = Text.replace("d","w")
'etc
end sub

And with the background worker just Write this inside the BackgroundWorkerAsync or something like that:

Encrypt()

You can write it where you want it to run the code.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top