Switch Quesiton

I have a static class set up like this

public class XPaths { \#region Y public struct ySeries { public static string[] hirg; public static string[] kata; public static string[] mixed; public static void Init() { hirg = new string[] { "/kana/hirg/ySeries/ya", "/kana/hirg/ySeries/yu", "/kana/hirg/ySeries/yo" }; kata = new string[] { "/kana/kata/ySeries/ya", "/kana/kata/ySeries/yu", "/kana/kata/ySeries/yo" }; mixed = new string[] { "/kana/hirg/ySeries/ya","/kana/kata/ySeries/ya", "/kana/hirg/ySeries/yu","/kana/kata/ySeries/yu", "/kana/hirg/ySeries/yo","/kana/kata/ySeries/yo" }; }//End INit }//End Struct #endregion } 

in another file I have a bunch of switch cases that go something like this

Random rnd = new Random(); int result = rnd.Next(0,4); strExpression = "y"; switch(result) { case 0: strExpression = XPaths.ySeries.hirg[0]; break; case 1: strExpression = XPaths.ySeries.hirg[1] break; //continued 

Is it better to use result in the subscript or should I just stick with the numbers?

by Braber02 via /r/csharp

Leave a Reply