if (st_live_score == "")
    {
           
    }
上面是变量无值时,判断语句,
哪么请问,变量为NULL时判断语句怎么写?

解决方案 »

  1.   

    if (st_live_score == null)
      

  2.   

    if (st_live_score == null)
      {
        
      }
      

  3.   

    string.ISNullorEmpty(st_live_score )
    st_live_score ==null
      

  4.   

    应该这样写为好:
    if (st_live_score == ""||st_live_score == null)
    {
    }
      

  5.   

     if(st_live_score.Equals(null))
    {
    }
      

  6.   

    if(string.ISNullorEmpty(txtbox.text))//判断为空或者为null
    {}
      

  7.   

    if (st_live_score == null||st_live_score == String.Empty)
    {
    }
      

  8.   

    别人又没问==""要判断,if( null == st_live_score )
    {
        do something
    }