我想将字符串中每个句子的第一个字母大写.我有一个字符串,例如."你好,你好吗?我很好,你呢?我很好.天气很好!"
我想把每个句子的第一个字母大写.所以,"你好,你好吗?我很好,你呢?" 等等
编辑:到目前为止,我刚试过
public static string FirstCharToUpper(string input)
{
if (String.IsNullOrEmpty(input))
throw new ArgumentException("ARGH!");
return input.First().ToString().ToUpper() + input.Substring(1);
}
Run Code Online (Sandbox Code Playgroud)
但这会使每个单词中的第一个字母大写,而不是句子:/