在每个单词的大写字母中使用第一个字符,但不使用罗马数字 [英] Making first char in each word caps, but not roman numerals

查看:71
本文介绍了在每个单词的大写字母中使用第一个字符,但不使用罗马数字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

除了罗马数字外,有人知道我如何将字符串中每个单词的第一个字符格式化为大写?我正在使用的代码行:

Does anyone know how I can format the first char of each word in a string to upper case except for roman numerals? The line of code I am using:

fmtedTxt = new System.Globalization.CultureInfo("en").TextInfo.ToTitleCase(txtTitle.Text.ToLower());



这会将字符串"Richard III"转换为"Richard Iii".

有人知道如何在C#中解决此问题吗?

预先感谢.



This will turn a string "richard III" into "Richard Iii".

Anyone know how to fix this in c#?

Thanks in advance.

推荐答案

显然没有简单的解决方法

http://wiki.novell.com/index.php/ECMAScript_Example [ http://stackoverflow.com/questions/1742712/textinfo-totitlecase- nott-work-properly-any-better-solution [ ^ ]

(都不在C#中)
Apparently there is no simple solution

http://wiki.novell.com/index.php/ECMAScript_Example[^]
http://stackoverflow.com/questions/1742712/textinfo-totitlecase-doesnt-work-properly-any-better-solution[^]

(neither is in C#)


这篇关于在每个单词的大写字母中使用第一个字符,但不使用罗马数字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆