String与string的区别
1.string
2.c# string映射为.net Framework的String ; 3.如果用string,编译器会把它编译成String,所以 4.如果使用c#,建议使用string,比较符合规范 ; 5.string始终代表 System.String(1.x) 或 ::System.String(2.0) ; 6.String只有在前面有using System;的时候并且当前命名空间中没有名为String的类型(class、struct、delegate、enum)的时候才代表System.String ; 7.string /**************************** * string.Empty * "" * 所以一般用string.Empty ****************************/ |