fork download
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Globalization;
  7. using System.Text.RegularExpressions;
  8. using System.IO;
  9. using System.Diagnostics;
  10. using System.Net.Mail;
  11. using System.Web;
  12.  
  13. namespace Enum
  14. {
  15. class Program
  16. {
  17. static void Main(string[] args)
  18. {
  19. string s = "aa bb cc dd ee ff gg hh ii kk";
  20. var array = s.Split( new string[] {" "}, StringSplitOptions.RemoveEmptyEntries);
  21. string newstring = "";
  22. for (int i = 0; i < 5; i++)
  23. newstring += array[i] + " ";
  24. Console.WriteLine(newstring.Trim());
  25.  
  26. }
  27. }
  28. }
  29.  
Success #stdin #stdout 0.04s 33968KB
stdin
Standard input is empty
stdout
aa bb cc dd ee