public static string[] MethodNames(string stackTrace) { MatchCollection mc = StackTrace.Matches(stackTrace); string[] res = new string[mc.Count]; for (int i = 0; i < res.Length; i++) res[i] = mc[i].Groups[1].Value; return res; }