is it possible in C# to use a String like a variable name ?
I have got a:
String x = "matrix1_2";
Microsoft.VisualBasic.PowerPacks.RectangleShape y = ???;
??? – there should be the name of variable…matrix1_2
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
No, you can’t, and it makes no sense honestly to have a feature like that.
If you need to dynamically assign some data with key and value, you could use an dictionary:
Then you can simply read the “variable” like