How do you use a string consisting of the same name as a variable in the code to act as this variable?
in
Programming Questions
•
1 year ago
I have a text file with something like
fruit;value1;value2;value3
strawberry;0;200;3
banana;20;0;0
and I have two
variables in my code called strawberry and banana.
If I split the file I get strawberry and banana as strings. But I want them to be variables.
What I want to do is this(if line 2 is in arrayx):arrayx[0] = "Hello world" which should lead to the variable strawberry containing the string "Hello world".
How do you use a string
consisting of the same name as a variable in the code to act as this variable?
1