摘要: 示例代码如下: namespace SampleListT { class Program { static void Main(string[] args) { //using System.Collections.Generic; 命名空间中的List<T> //using System.Collections; 命名空间中的ArrayList //都实现了列表集合,一个是泛形集合,一个是非泛型的 //下面我们将Person对象加到集合中 Person p1 = new Person( "aladdin" , 20 ); ... 阅读全文
posted @ 2011-11-01 14:38 天涯海客 阅读(394) 评论(0) 推荐(0) 编辑
摘要: C#格式化数值结果表字符说明示例输出C货币string.Format("{0:C3}", 2)$2.000D十进制string.Format("{0:D3}", 2)002E科学计数法1.20E+0011.20E+001G常规string.Format("{0:G}", 2)2N用分号隔开的数字string.Format("{0:N}", 250000)250,000.00X十六进制string.Format("{0:X000}", 12)Cstring.Format("{0:000. 阅读全文
posted @ 2011-11-01 14:29 天涯海客 阅读(190) 评论(0) 推荐(0) 编辑