我所做的是:
string str = "This is my style"; string [] output = str.Split(' '); foreach(string s in output) { Console.Write(s[0]+" "); } // Output T i m s
我想以最短的方式显示相同的输出…
谢谢
string str = "This is my style"; str.Split(' ').ToList().ForEach(i => Console.Write(i[0] + " "));