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& ...
随机推荐
- GROUP BY 與 Null 值
若群組資料行包含了 Null 值,該資料列將變成結果中的一個群組.若群組資料行內包含了多個 Null 值,Null 值將放入單一群組內.此行為定義於 SQL-2003 標準之中. Product 資料 ...
- C# ArrayList
一.定义 System.Collections.ArrayList类是一个特殊的数组(即动态数组).通过添加和删除元素,就可以动态改变数组的长度. 二.优点 动态的增加和删除元素,实现了ICollec ...
- 利用session完成用户登陆
package cn.itcast.cookie; import java.io.IOException; import java.io.PrintWriter; import java.util.L ...
- centos yum 使用笔记
yum 参数说明yum -y # 表示自动选择 基本使用# yum -y install 包名(支持*) :自动选择y,全自动# yum install 包名(支持*) :手动选择y or n# yu ...
- C#编程利器之二:结构与枚举(Structure and enumeration)【转】
C#编程利器之二:结构与枚举(Structure and enumeration) 在上一篇文章中,介绍了类如何封装程序中的对象.而实际中,出了类可以封装对象外,结构和枚举也可以封装一些对象,本文将着 ...
- 模块加载----Webpack
一.配合gulp编译sass与压缩js 1.安装node.js 2.全局安装webpack 打开npm窗口执行 npm install webpack –g 3. 在项目中使用webpack 使用np ...
- BI系统与KPI指标的整合分析
今天我们要说的是信息化时代下关于企业运营的两个热词:BI系统和KPI指标.一直到现在,企业运营的方方面面都在被数据化,成为庞大信息流的一部分,这一庞大的信息流,正以我们自己都尚未完全意识到的速度和规模 ...
- Java基础之扩展GUI——使用字体对话框(Sketcher 5 displaying a font dialog)
控制台程序. 为了可以选择系统支持的字体,我们定义了一个FontDialog类: // Class to define a dialog to choose a font import java.aw ...
- 20145320 《Java程序设计》第2周学习总结
20145320 <Java程序设计>第2周学习总结 教材学习内容总结 3.1 类型.变量与运算符 基本类型 整数(short.int.long) .字节(byte) .浮点数(float ...
- Leetcode: Assign Cookies
Assume you are an awesome parent and want to give your children some cookies. But, you should give e ...