String. Empty! = NULL;
If a textbox has no value, if (textbox. Text = string. Empty) ==> the result is: False
If (textbox. Text = string. Empty) => the result is:True;
In 2.0If the string is null string. isnullorempty (STR) = true, the string is null (null and "");
Note: "=" can only determine whether the "references" of two strings are the same;
To confirm whether the two strings are the same, use equals.
Example:
String STR = "Sss"; // STR cannot be null. It can be "";
String STRs = NULL;
Str. Equals (STRs) = false;
If STR = "";
Str. Equals (STRs) = false;
// Obtain the location code of Chinese Characters
Byte [] array = new byte [2];
Array = system. Text. encoding. Default. getbytes ("ah ");
Int I1 = (short) (array [0]-'\ 0 ');
Int I2 = (short) (array [1]-'\ 0 ');
// Chinese character codes in Unicode decoding mode
Array = system. Text. encoding. Unicode. getbytes ("ah ");
I1 = (short) (array [0]-'\ 0 ');
I2 = (short) (array [1]-'\ 0 ');
// Unicode deserialization for Chinese Characters
String STR = "4a55 ";
String S1 = Str. substring (0, 2 );
String S2 = Str. substring (2, 2 );
Int T1 = convert. toint32 (S1, 16 );
Int t2 = convert. toint32 (S2, 16 );
Array [0] = (byte) T1;
Array [1] = (byte) T2;
String S = system. Text. encoding. Unicode. getstring (array );
// Decodes Chinese characters in the default mode
Array [0] = (byte) 196;
Array [1] = (byte) 207;
S = system. Text. encoding. Default. getstring (array );
// Obtain the string length
S = "Iam square gun ";
Int Len = S. length; // will output as 6
Byte [] Sarr = system. Text. encoding. Default. getbytes (s );
Len = Sarr. length; // will output as 3 + 3*2 = 9
// String Addition
System. Text. stringbuilder sb = new system. Text. stringbuilder ("");
SB. append ("I ");
SB. append ("am ");
SB. append ("square gun ");