fork download
  1. using System;
  2.  
  3. public class Test
  4. {
  5. public static void Main()
  6. {
  7. string s = "someMethod(999,'xyz')";
  8. string BetweenBrackets = s.Substring(s.IndexOf("(") + 1, s.IndexOf(")") - s.IndexOf("(") - 1);
  9. string[] array = BetweenBrackets.Split(new char[] { ',', '\'' }, StringSplitOptions.RemoveEmptyEntries);
  10. Console.WriteLine(array[0]); //999
  11. Console.WriteLine(array[1]); //xyz
  12. }
  13. }
Success #stdin #stdout 0.04s 33976KB
stdin
Standard input is empty
stdout
999
xyz