例如:
string s = "Hello world!";
String S = "Hello world!";
两种字符串应该如何使用?并且他们之间的差异是什么?
发布于 2018-02-07 09:10:33
就我所知,你不能以string
、int
等方式建立全局别名。但是,你可以使用using关键字对类型和namespace进行更本地化的别名。
例如:
using str = System.String;
using strDict = System.Collections.Generic.Dictionary<string, string>;
//...
str s = "Now you've got another alias for string!";
var d = new strDict();
https://stackoverflow.com/questions/-100003174
复制相似问题