如何在C#中拆分字符串

0 c# string

我有一个字符串.例:

Eternal (woman)
Run Code Online (Sandbox Code Playgroud)

我想成功Eternal (Woman).

我怎么能在C#中做到这一点?

如果我用字符串[]分割= inf.Meaning.Split('(');然后我就无法得到(.

Luk*_*keH 6

您的示例数据根本不需要拆分以获得所需的结果:

string foo = "Eternal (woman)";
string bar = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(foo);

Console.WriteLine(bar);    // "Eternal (Woman)"
Run Code Online (Sandbox Code Playgroud)

您的真实数据有何不同?你真的需要因某种原因拆分字符串吗?