如果一个对象不为空null时,把它赋给另外一个对象:

像下面这个样子,需要把str的值赋给result,前提条件是在不为空null的前提之下:
判断是否为空然后赋值

 

class Aj
    {
        public void DemoNUll()
        {
            string str = null;
            string result = "";          

        }
    }
Source Code

相关文章:

  • 2022-12-23
  • 2022-01-07
  • 2021-11-28
  • 2021-11-28
  • 2021-11-27
  • 2021-12-04
  • 2021-06-11
  • 2021-09-23
猜你喜欢
  • 2021-11-05
  • 2022-12-23
  • 2021-11-05
  • 2022-12-23
  • 2021-11-02
  • 2021-11-05
相关资源
相似解决方案