fork download
  1. using System;
  2. using System.Linq;
  3.  
  4. public class Test
  5. {
  6.  
  7. public static void Main()
  8. {
  9. string str = "The quick brown fox jumps over the lazy dog";
  10. string[] words = str.Split();
  11. string res = String.Join(" ", words.Select((w, i) => i == 0 ? w : words[i-1].Last() + w).ToArray());
  12. Console.Write(res);
  13. }
  14. }
Success #stdin #stdout 0.03s 33904KB
stdin
Standard input is empty
stdout
The equick kbrown nfox xjumps sover rthe elazy ydog