fork download
  1. using System;
  2.  
  3. public class Test
  4. {
  5. public static void Main()
  6. {
  7. string s = "Item Name {Item Code} {Item ID}";
  8. int index1 = s.IndexOf('{');
  9. int index2 = s.IndexOf('}');
  10. string result = s.Substring(index1 + 1, index2 - index1 - 1);
  11. Console.WriteLine(result);
  12. }
  13. }
Success #stdin #stdout 0.03s 34736KB
stdin
Standard input is empty
stdout
Item Code