The simplest way is:
Dim DeclaredVariables As Dictionary(Of String, String) = New Dictionary(Of String, String)
DeclaredVariables.Add("wah","123")
DeclaredVariables.Add("wha","132")
DeclaredVariables.Add("awh","213")
DeclaredVariables.Add("ahw","231")
DeclaredVariables.Add("haw","321")
DeclaredVariables.Add("hwa","312")
Dim writArg As String = "wha"
writArg = DeclaredVariables(writArg)
But i need to warn you: this may cause
KeyNotFoundException[
^], so you should avoid this by using
Try... Catch... End Try statement[
^]:
Try
writArg = DeclaredVariables(writArg)
Catch ex As KeyNotFoundException
Console.WriteLine("{0}", ex.Message)
End Try