Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试在 C# 中获取字符串(电子邮件主题)的前 3 个单词,以前有人这样做过吗?感谢您的帮助
string result = string.Join(" ", str.Split().Take(3)); (已编辑)
string result = string.Join(" ", str.Split().Take(3));
List<string> myWordsList = myWords.Split(' ').Take(3).ToList();