String is null or empty

zhaozj2021-02-16  94

Using system;

Namespace Test

{Class clsmain {

Private static string a; [stathread] static void main (string [] args) {string b;

IF (b == ") {Console.WriteLine (" b IS empty ");}

IF (b == null) {console.writeLine ("b is null");} if (a == ") {Console.WriteLine (" a is empty ");} if (a == null) {Console .Writeline ("a is null");}

}

}

} Guess the result of the running of the run. Turn String B to string b = string.empty; IF (b == "")

If "" is meaningful, you can start B = "- 1" to initial words and add a comment, should be better than judging whether it is null or EMPTY

转载请注明原文地址:https://www.9cbs.com/read-10606.html

New Post(0)