object转字符串

1、obj.tostring()

obj为空时,抛异常。

2、convert.tostring(obj)

obj为空时,返回null;

3、(string)obj

obj为空时,返回null;obj不是string类型时,抛异常。

4、obj as string

obj为空时,返回null;

原文地址:https://www.cnblogs.com/snake1118/p/7110302.html