摘要: 1.使用StringBuilder拼接字符串实例: string[] lines = File.ReadAllLines("sdjk.txt", Encoding.Default); //创建监视对象 Stopwatch watch = new Stopwatch(); Strin... 阅读全文
posted @ 2015-08-02 13:29 Bronc_Li 阅读(185) 评论(0) 推荐(0) 编辑
摘要: char[] ch=new char(){'1','2','3'}; string str=new string(ch); 通过new关键字,就可以将一个字符数组转换为字符串类型的数组。 阅读全文
posted @ 2015-08-02 09:31 Bronc_Li 阅读(611) 评论(0) 推荐(0) 编辑
摘要: 1. string字符串,字符串可以看成字符数组,由于它的不可变性,所以使用for循环来修改string中元素是失败的。 ·属性: ·Length//获得字符串中的字符的个数. ·方法: ·IsNullOrEmpty()//静态方法,判断为null或者为""(静态方法)和if(msg==null||msg=="")一样的效果。 ... 阅读全文
posted @ 2015-08-02 09:29 Bronc_Li 阅读(313) 评论(0) 推荐(0) 编辑