1、obj.tostring()

obj为空时,抛异常。

2、convert.tostring(obj)

obj为空时,返回null;

3、(string)obj

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

4、obj as string

obj为空时,返回null;

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-10-17
  • 2021-06-12
  • 2022-12-23
  • 2021-10-13
  • 2021-11-03
猜你喜欢
  • 2021-06-26
  • 2021-10-07
  • 2021-08-27
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案