fork download
  1. using System;
  2.  
  3. public class Test
  4. {
  5. public static void Main()
  6. {
  7. var str1 = "string(1)_2013-02-15";
  8. var str2 = "anotherString(2)_2013-02-15";
  9. var str3 = "ayetAnotherString(3)_2013-02-15";
  10.  
  11. int leftBrace = str1.IndexOf('(');
  12. int rightBrace = str1.IndexOf(')', leftBrace);
  13. str1 = str1.Remove(leftBrace, rightBrace - leftBrace + 1);
  14. leftBrace = str2.IndexOf('(');
  15. rightBrace = str2.IndexOf(')', leftBrace);
  16. str2 = str2.Remove(leftBrace, rightBrace - leftBrace + 1);
  17. leftBrace = str3.IndexOf('(');
  18. rightBrace = str3.IndexOf(')', leftBrace);
  19. str3 = str3.Remove(leftBrace, rightBrace - leftBrace + 1);
  20. Console.WriteLine(str1);
  21. Console.WriteLine(str2);
  22. Console.WriteLine(str3);
  23. }
  24. }
Success #stdin #stdout 0.03s 33872KB
stdin
Standard input is empty
stdout
string_2013-02-15
anotherString_2013-02-15
ayetAnotherString_2013-02-15