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.
我有一个名字列表:
Jacqueline Beaurivage (loh Da road); Bon Van Daht (fary goal lim) Bon Jobi (ting wei) Ting Wan (dehtee road);
如何使用 C# 字符串搜索方法将名称存储到变量中?
基本上我在“ (”之后什么都不想要了。什么是最有效和最简单的方法?
var name = string.Split('(')[0].Trim()
new Regex("^[^(]+", RegexOptions.Multiline).Matches(string);