我需要一个简单的 C# 问题解决方案
输入:任何身体都可以跳舞
输出:ABCD
string inputString = "Another One Bites The Dust And Another One Down";
string[] split = inputString.Split();
foreach (string s in split)
{
Console.Write(s.Substring(0,1));
}
看一下这个:
string s = new string("Any Body Can Dance"
.Split(' ')
.Select(x => x.First())
.ToArray());
Console.WriteLine(s);