using System; public class Test { public static void Main() { string temp = "01_Barnsley123"; string textIWant = temp.Remove(11, 4); Console.WriteLine(textIWant); } }
Standard input is empty
Standard output is empty
Unhandled Exception: System.ArgumentOutOfRangeException: Index and count must refer to a location within the string. Parameter name: count at System.String.Remove (System.Int32 startIndex, System.Int32 count) [0x00055] in <8f2c484307284b51944a1a13a14c0266>:0 at Test.Main () [0x00006] in <d219f26cf6e445a49a0f4f88fab6d691>:0 [ERROR] FATAL UNHANDLED EXCEPTION: System.ArgumentOutOfRangeException: Index and count must refer to a location within the string. Parameter name: count at System.String.Remove (System.Int32 startIndex, System.Int32 count) [0x00055] in <8f2c484307284b51944a1a13a14c0266>:0 at Test.Main () [0x00006] in <d219f26cf6e445a49a0f4f88fab6d691>:0