为什么默认情况下只有文字字符串保存在实习池中?
来自MSDN的示例:
String s1 = "MyTest";
String s2 = new StringBuilder().Append("My").Append("Test").ToString();
String s3 = String.Intern(s2);
Console.WriteLine("s1 == '{0}'", s1);
Console.WriteLine("s2 == '{0}'", s2);
Console.WriteLine("s3 == '{0}'", s3);
Console.WriteLine("Is s2 the same reference as s1?: {0}", (Object)s2==(Object)s1);
Console.WriteLine("Is s3 the same reference as s1?: {0}", (Object)s3==(Object)s1);
/*
This example produces the following results:
s1 == 'MyTest'
s2 == 'MyTest'
s3 == 'MyTest'
Is s2 the same reference as s1?: False
Is s3 the same reference as s1?: True
*/
Run Code Online (Sandbox Code Playgroud) 如何检查数组中所有TextBox控件的Tag属性?
我想要这样的东西:
If textBox.Tag And textbox2.Tag And textbox21.Tag And
textbox22.Tag And textbox23.Tag And textbox24.Tag = "2" Then
Run Code Online (Sandbox Code Playgroud)
这是我的TextBoxes数组:
Dim allTextboxes() As TextBox = {textBox, narNaslov, narPersona, narDani, narPersona2,
kupIme, kupAdresa, kupKontakt, uvBroj, uvDatum, uvIznos,
uvAvans, uvRok, uvNacin, datumTbox}
Run Code Online (Sandbox Code Playgroud)