TextInfo
https://msdn.microsoft.com/en-us/library/system.globalization.textinfo.totitlecase(v=vs.110).aspx
Converts the specified string to title case (except for words that are entirely in uppercase, which are considered to be acronyms).
Remarks
Generally, title casing converts the first character of a word to uppercase and the rest of the characters to lowercase.
However, this method does not currently provide proper casing to convert a word that is entirely uppercase, such as an acronym.
The following table shows the way the method renders several strings.
|
Input |
Language |
Expected result |
Actual result |
|---|---|---|---|
|
war and peace |
English |
War and Peace |
War And Peace |
|
Per anhalter durch die Galaxis |
German |
Per Anhalter durch die Galaxis |
Per Anhalter Durch Die Galaxis |
|
les naufragés d'ythaq |
French |
Les Naufragés d'Ythaq |
Les Naufragés D'ythaq |
As illustrated above, the ToTitleCase method provides an arbitrary casing behavior which is not necessarily linguistically correct.
A linguistically correct solution would require additional rules, and the current algorithm is somewhat simpler and faster.
We reserve the right to make this API slower in the future.
The current implementation of the ToTitleCase method yields an output string that is the same length as the input string.
However, this behavior is not guaranteed and could change in a future implementation.
TextInfo的更多相关文章
- 吴裕雄 Bootstrap 前端框架开发——Bootstrap 辅助类:"text-info" 类的文本样式
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title> ...
- Bootstrap WPF Style,Bootstrap风格的WPF样式
简介 GitHub地址:https://github.com/ptddqr/bootstrap-wpf-style 此样式基于bootstrap-3.3.0,样式文件里的源码行数都是指的这个版本.CS ...
- .net汉字转字母
目前手上有一个需要实现:将用户输入的姓名转换成汉语拼音. 使用枚举,既麻烦又易出错,发现有一个微软拼音转换工具类ChnCharInfo.dll,在此记录下: 首先需要引入此dll, 链接: http: ...
- C#开发微信门户及应用(12)-使用语音处理
我们知道,微信最开始就是做语音聊天而使得其更加流行的,因此语音的识别处理自然也就成为微信交流的一个重要途径,微信的开发接口,也提供了对语音的消息请求处理.本文主要介绍如何利用语音的识别,对C#开发的微 ...
- ABP集合贴
thead>tr>th,.table>tbody>tr>th,.table>tfoot>tr>th,.table>thead>tr>t ...
- [转]Code! MVC 5 App with Facebook, Twitter, LinkedIn and Google OAuth2 Sign-on (C#)
本文转自:https://www.asp.net/mvc/overview/security/create-an-aspnet-mvc-5-app-with-facebook-and-google-o ...
- Bootsrap基本应用
Bootsrap 用法: <!DOCTYPE html> <html lang="en"> <head> <meta charset=&q ...
- bootstrap自学总结不间断更新
2.栅格系统 container-fluid 自适应宽度100% container 固定宽度(适应响应式) 屏幕宽度=x x>=1200 1170 992< ...
- bootstrap学习笔记--bootstrap排版类的使用
标题 Bootstrap 中定义了所有的 HTML 标题(h1 到 h6)的样式,这个和一般的html没啥区别.请看下面的实例: <h1>测试1 h1</h1> <h2& ...
随机推荐
- scala基础语法(变量,数据类型,函数)
一:常量与变量 1.常量 2.两种变量定义方式(严格与不严格) 3.Float注意点 3.注意点 变量名后加上: 类型首字母是大写 4.占位符_ 但是需要制定类型 5.scala数据类型 6.其他类型 ...
- lleetcode 292. Nim Game
You are playing the following Nim Game with your friend: There is a heap of stones on the table, eac ...
- 显示HTML文本
+ (NSAttributedString*)getAttributedStringFromHtmlString:(NSString*)htmlString{ return [[NSAttribute ...
- SEO之HTML优化:让你的网站HTML代码更符合SEO规范
摘要HTML优化是网站内部优化的重点,可能对SEO新手来说,容易忽略.符合搜索引擎习惯的HTML代码是极利于SEO的,可以让你的网站获得更好的搜索引擎排名.如何制作一个标准的HTML网页,如何做HTM ...
- android 自定义控件
学习参考:http://blog.csdn.net/hudashi/article/details/50913257 http://blog.csdn.net/gebitan505/article/d ...
- join用法
join命令可以将多个文件结合在一起,每个文件里的每条记录,都共享一个键值(key),键值指的是记录中的主字段,通常会是用户名称.个人姓氏.员工编号之类的数据. join - join lines o ...
- iOS解析JSON字符串报错Error Domain=NSCocoaErrorDomain Code=3840 "Invalid escape sequence around character 586."
将服务器返回的JSON string转化成字典时报错: Error Domain=NSCocoaErrorDomain Code=3840 "Invalid escape sequence ...
- input上传按钮 文字修改办法
解决思路是把input 放在文字的上边,弄成透明的,这样在点文字时,实际是点击了input,这样就实现了文件的上传. 具体代码: <style> #uploadImg{ font-size ...
- oracle生成主键
SELECT 'ZTO'||TO_CHAR(SYSDATE,'yymmdd')||TO_CHAR(SEQ_COMMON_ORDER.NEXTVAL,'FM00000000') AS orderCode ...
- UCOS 解读代码
1.OSInit()函数:建立两个任务,一个是空闲任务,在任何任务没有就绪时运行,一个是统计任务,计算cpu的利用率.初始化 UCOSII 的所有变量和数据结构,2.OSTaskCreate 该函数返 ...