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& ...
随机推荐
- IOS第12天(1,UIViewController控制器的创建的 三种方式,和第一个view创建)
*************HMAppDelegate.m中 @implementation HMAppDelegate - (BOOL)application:(UIApplication *)app ...
- mongod 命令执行发现已经有进程在运行mongod数据库--errno:48 Address already in use for socket: 0.0.0.0:27017
错误信息: listen(): bind() failed errno:48 Address already in use for socket: 0.0.0.0:27017 27017端口已经被占用 ...
- 解决thrift: ···No such file or directory问题
感谢Anker分享:error while loading shared libraries: xxx.so.x" 错误的原因和解决办法 今天在装thrift的时候遇到一个这样的问题: ro ...
- ios-WKWebView 拨打电话
-(void)webView:(WKWebView* )webView didStartProvisionalNavigation:(WKNavigation* )navigation { NSStr ...
- ScriptManager.RegisterStartupScript
如果页面中不用Ajax,cs中运行某段js代码方式可以是:Page.ClientScript.RegisterStartupScript(Page.GetType(), "", & ...
- ssm maven项目启动 报SYSTEM_PROPERTIES_MODE_ENVIRONMENT
1.jar包冲突,查看项目中的jar和pom.xml中配置的jar包 版本,把没用的jar包删掉
- UIAlertController 的使用
IAlertController 同时替代了 UIAlertView 和 UIActionSheet,从系统层级上统一了 alert 的概念 —— 即以 modal 方式或 popover 方式展示. ...
- C#中的特性基本理解
定制特性可以应用的目标元素可以为:程序集(assembly).模块(module).类型(type).属性(property).事件(event).字段(field).方法(method).参数(pa ...
- 《Linux内核分析》第七周 可执行程序的装载
[刘蔚然 原创作品转载请注明出处 <Linux内核分析>MOOC课程http://mooc.study.163.com/course/USTC-1000029000] WEEK SEVEN ...
- JMeter学习-007-JMeter 断言实例之一 - 响应断言
之前的文章中已经对如何录制 web 的请求进行了详细的描述,敬请参阅:JMeter学习-004-WEB脚本入门实战 同时,我们的手机应用(例如:京东.天猫.唯品会.携程.易迅 等等 App)所发出的请 ...