What is the difference between these three ways to clear a Textbox?

前端 未结 10 522
孤城傲影
孤城傲影 2021-02-01 17:11

I am bit confused between the below three ways to clear the contents of a textbox. I am working with WPF and found All are working, but I am unable to find the difference.

10条回答
  •  抹茶落季
    2021-02-01 17:28

    "" creates an object while String.Empty creates no object. So it is more efficient to use String.Empty.

    Refference: String.Empty vs ""

    Regarding .Clear() i didnot get better answer then @syned's answer.

提交回复
热议问题