I have a collection of strings. For example,
string[] coll={"1", "2", "3" ..."100"..."150"...}
and I have respective methods for the string collection such as
void Method1, void Method2, void Method100
I select appropriate method like that:
string selector=string.Empty;
switch(selector)
{ case "1":
MethodOne();
break;
........
case "150":
Method150();
break;
}
The above code is really bored and I will have more string elements in the string collection {"150" ... "250"...}. How to make like that:
string sel=col[55];
if(sel!=null)
// call here the respective method(method55)
I do not want to use switch operator cause it gives rise to surplus of code.