Of the two examples beneath, which is better and why? What is conventional best practice?
this way...
switch(myArrayList[line].ToString().Trim().Substring(0, 1).ToString())
{
case "A":
break;
case "B":
break;
case "C":
break;
}
or this way...
string easierReadShorter = myArrayList[line].ToString().Trim().Substring(0, 1).ToString();
switch(easierReadShorter)
{
case "A":
break;
case "B":
break;
case "C":
break;
}

New Topic/Question
Reply




MultiQuote





|