摘要: 见下代码:using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace Encoding{ class A { public string Mys = string.IsInterned("Hello"); } class Program { static void Main(string[] args) { string[] sarr = new string[]{"a","我"... 阅读全文
posted @ 2013-11-14 22:03 zzunstu 阅读(170) 评论(0) 推荐(0) 编辑
摘要: string1.一个string表示一个恒定不变的字符序列集合。 string直接继承自System.Object,这使得他成为一个引用类型,也就是说线程的堆栈上不会驻留有任何字符串。 注:直接继承自Object的类型一定是引用类型;所有的值类型都继承自System.ValueType,,但System.ValueType却是一个引用类型(public abstract class ValueType);如下Code:string s=new string("Hello");无法通过编译。但是可以用string s = new string(char[] chars);st 阅读全文
posted @ 2013-11-14 22:02 zzunstu 阅读(136) 评论(0) 推荐(0) 编辑