Convert variable name to string.
Ok, I am reading a text file, the file contains variables and the values I want to assign to them. Is there any way to convert strings to variable names.
Example text file
Code:
[variable1]
:value
[variable2]
:value1:value2:value3
basically i want to do something like
Code:
String[] varNames = (get input from txt file);
String[] vals = (get input from txt file);
for(int index = 0; index < varNames; index++){
(convert varNames[index] to variable) = vals[get input]
}
i know i would have to handle it differently if the val was an array. This is just an example, but is there any way to do this?