深入解析值类型的初始化过程!
摘要:大家看一个结构体定义: struct Book { public string author; public Book(string author) { this.author = author; } public string Author { get { return author; } set { author = value; } } }下面是初始化代码: static void Main...
阅读全文
posted @
2009-12-06 23:15
周雪峰
阅读(1700)
推荐(1) 编辑
通过string.Split()方法,谈谈VB.NET编译器和C#编译器的一点差别!
摘要:问题起源于微软官方论坛中的一个帖子,他给出了一段VB.NET编写的代码: Dim stralltext As String = My.Computer.FileSystem.ReadAllText("c:\magic.txt") Dim StrLines() As String = stralltext.Split(ControlChars.CrLf)大家看第二行的Split方法调用,Contro...
阅读全文
posted @
2009-12-05 16:06
周雪峰
阅读(2542)
推荐(0) 编辑