What is the difference between (“”) and (null)

前端 未结 9 1162
鱼传尺愫
鱼传尺愫 2021-01-04 18:33

While trying to set Validations i initially encountered some problems with checking if a textbox is null, i tried using

    private void btnGo_Click(object s         


        
9条回答
  •  再見小時候
    2021-01-04 19:04

    "" is an empty string vs null which means "does not exist".

    In your case, you first compared name to "does not exist" which was false because name did exist. Then you compared name to empty string which is true because it has the value of an empty string.

提交回复
热议问题