以 Nullable 的整型为例。
int? m = 3; int? n = null; m.ToString(); // 结果为 3。 n.ToString(); // 结果为 Emtpy,不是 null。
如上可以看出,Nullable 的数字,可以使用 ToString,但不能带参数,即不能格式化字符串。
null ToString 后结果为 Empty(零长度字符串),不是 null。
创建于2005年 渝ICP备05010272号-1
电邮:cftea@126.com