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.
我有一个以下格式的字符串数组。
string[] sports = { "Cricket" , "Football" ,"Boxing/Tennis " , "Soccer"} ;
是否有任何内置方式在 C# 中或使用 LINQ 在数组中拆分字符串并返回新数组,如
string[] sportsNewArray = { "Cricket" , "Football" ,"Boxing" , "Tenis " , "Soccer"} ;
string[] sportsNewArray = sports.SelectMany(s=>s.Split('/')).ToArray();