8 public static char Query(string msg, string selections, char defaultSelection)
\r
11 while (resNum < 0) {
\r
13 string response = Console.ReadLine();
\r
14 response = response.Trim().ToLower();
\r
15 if (response.Length < 1) return defaultSelection;
\r
16 resNum = selections.ToLower().IndexOf(response[0]);
\r
18 return selections[resNum];
\r
21 public static bool Confirm(string msg, bool defaultSelection)
\r
23 return Query(msg, "yn", defaultSelection? 'y' : 'n') == 'y';
\r