I have this code, where i have an arrayList. I use the method arrayList.Contains.
if (arrayList2.Contains(5))
{
//something
}
I would like to replace arrayList2 in the code, with a variable (a string for example) that contains the value arrayList2.
string hello = "arrayList2" // create a varible with the value of the name of the arrayList
if (hello.Contains(5)) // insert the variable "hello" instead of "arrayList2"
{
//something
}
This method doesn't work, any ideas how i can get it to work?