如何为小写,除了用C#第一个字符的字符串 [英] How to lowercase a string except for first character with C#
本文介绍了如何为小写,除了用C#第一个字符的字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何转换成字符串除了第一个字符为小写?
可以这样使用LINQ完成?
感谢
解决方案
字符串newString =新的String(str.Select((CH,指数)=>(指数== 0)CH:?Char.ToLower(CH))ToArray的()) ;
How do convert a string to lowercase except for the first character? Can this be completed with LINQ?
Thanks
解决方案
String newString = new String(str.Select((ch, index) => (index == 0) ? ch : Char.ToLower(ch)).ToArray());
这篇关于如何为小写,除了用C#第一个字符的字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文