Monday, 9 October 2017

Difference between String.Empty and "" ?

string s1=String.Empty;

-->This is a read-only field actually assigned to a constant.
-->String.Empty creates no object, 

string s2="";

--> "" is an immediate constant, (created every time you place it in the code).
-->  "" creates an object

No comments:

Post a Comment

React Hooks - custom Hook

  v CustomHook Ø React allows us to create our own hook which is known as custom hook. Example – 1 localStorage Demo Step-1 Create ...