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天(2,UINavigationController导航控制器)
****HMAppDelegate.m @implementation HMAppDelegate - (BOOL)application:(UIApplication *)application d ...
- 解决Sublime Text 3 Package Control 问题
我使用的环境是 Mac OS X 10.11.5. 安装Packet Control之后,尝试安装插件,出现如下问题: There are no packages available for inst ...
- phpcms 导航栏点击栏目颜色定位方法和phpcms list页实现分页
另:一个栏目下面如果没有子栏目,那么它调用的模板就是列表页模板(及list_为前缀的模板):如果一个栏目下面有子栏目,那么它调用的就是栏目首页模板(category_为前缀的模板). 当你这个栏目添加 ...
- pycharm 单元测试失败 not found while handling absolute import
pycharm 单元测试运行错误 RuntimeWarning: Parent module 'tests' not found while handling absolute import impo ...
- iOS:搭建本地的服务器
一.介绍 作为一个专业的程序员,不管你是前端还是移动端或者是后台,能够自己试着搭建一个本地的服务器还是很有必要的,有的时候,我们可以自己测试一些数据,很方便开发.其实,mac是自带有本地的服务器的,用 ...
- iOS:高德地图的使用
本人花了点时间集成了高德地图的几乎所有的功能,包含:地图的显示.地图的绘制.地图的定位.地图的POI数据检索.地图的线路规划.地图导航等下载地址如下:https://github.com/xiayua ...
- centos 下 安装zookpeer
tar xvf zookeeper-3.4.6.tar.gz cd /usr/local/zookpeer/ mkdir /var/zookpeer mkdir /var/zookpeer/data ...
- Android应用程序窗口(Activity)与WindowManagerService服务的连接过程分析
在前两文中,我们分析了Activity组件的窗口对象和视图对象的创建过程.Activity组件在其窗口对象和视图对象创建完成之后,就会请求与WindowManagerService建立一个连接,即请求 ...
- HTML两张图片叠加问题的进一步修改
要想两张图片叠加,只需在circle添加一个Position:absolute就OK了 以上几步,很多大侠前辈都已经说过,相信不用再啰嗦,我想说的是一种扩展,将示例放到右边,可能因为我悟性低,研究了一 ...
- Spring 计划
3.0----------------------------------------------------- SCRUM 流程的步骤2: Spring 计划 1. 确保product backlo ...