Is it possible to reference a variable/array using another variable in asp.net c#? EG.
alfaromeo = new string[] {"lots of stuff"};
astonmartin = new string[] {"lots of stuff"};
audi = new string[] {"lots of stuff"};
bentley = new string[] {"lots of stuff"};
bmw = new string[] {"lots of stuff"};
etc
string targetArray = "audi";
for(int i=0; i<targetArray.Length; i++){
// do stuff with tha array
}
There is a reason the arrays are all called different names and I'm not using a multi dimensional array to referance them.
Can this be done, or do I need to use some sort of look up array to reference them?
Thanks in advance.
string targetArray = "audi";is this aStringor aString[]?