Tag: title case

将字符串转换为来自TitleCase C#的camelCase

我有一个字符串,我转换为TextInfo.ToTitleCase并删除了下划线并将字符串连接在一起。 现在我需要将字符串中的第一个字符和第一个字符更改为小写字母,由于某种原因,我无法弄清楚如何完成它。 在此先感谢您的帮助。 class Program { static void Main(string[] args) { string functionName = “zebulans_nightmare”; TextInfo txtInfo = new CultureInfo(“en-us”, false).TextInfo; functionName = txtInfo.ToTitleCase(functionName).Replace(‘_’, ‘ ‘).Replace(” “, String.Empty); Console.Out.WriteLine(functionName); Console.ReadLine(); } } 结果:ZebulansNightmare 期望的结果:zebulansNightmare 更新: class Program { static void Main(string[] args) { string functionName = “zebulans_nightmare”; TextInfo txtInfo = new CultureInfo(“en-us”, false).TextInfo; functionName = […]