fork download
  1. using System;
  2. using System.Linq;
  3. using System.Collections.Generic;
  4.  
  5. public class Test
  6. {
  7.  
  8. public static void Main()
  9. {
  10. string instr = "test";
  11.  
  12. int startIndex = 1;
  13. int length = 2;
  14. char[] chars = instr
  15. .Where((c, i) => i >= startIndex && i < startIndex + length).ToArray();
  16.  
  17. Console.Write(new string(chars));
  18. }
  19. }
Success #stdin #stdout 0.02s 33848KB
stdin
Standard input is empty
stdout
es