Most advisable way of checking empty strings in C#

后端 未结 7 879
抹茶落季
抹茶落季 2020-12-13 01:51

What is the best way for checking empty strings (I\'m not asking about initializing!) in C# when considering code performance?(see code bel

7条回答
  •  难免孤独
    2020-12-13 02:33

    I think the best way is if(string.IsNullOrEmpty(a)) because it's faster and safer than the other methods.

提交回复
热议问题