码迷,mamicode.com
首页 > 其他好文 > 详细

05.格式化字符串的用法_在help里怎么找到

时间:2016-01-08 20:28:13      阅读:155      评论:0      收藏:0      [点我收藏+]

标签:

谷歌百度MSDN里各种搜索"格式化""format",找不到...

找到msdn里的string.format , 第一个参数的说明composite format string. (复合格式字符串)点开,往下滚一下:

Format Item Syntax

Each format item takes the following form and consists of the following components:

{index[,alignment][:formatString]}

The matching braces ("{" and "}") are required.

可以用哪些格式字符,继续往下翻;
==========================================================
{index[,alignment][:formatString]}
{0,-10:D}
alignment表示对齐,负数左对齐,整数右对齐;数字大小表示字符宽度,小于字符串的长度时无效;
formatString,参见帮助里的各种格式,数字的,时间日期的,其他各种的..

Illustrated C# 2012_C#图解教程.pdf里有详细的讲解;






05.格式化字符串的用法_在help里怎么找到

标签:

原文地址:http://www.cnblogs.com/QIAOXINGXING001/p/5114251.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!