: , , #, . # StringBuilder, System.Text. , . , , C# string, StringBuilder.
switch
string switch. , switch. , . , , "", "" "".
// switch .
Using System;
class StringSwitch { static void Main() {
string[] strs = { "", "", "", "", "" };
foreach(string s in strs) { switch (s) {
case "":
Console.Write (1);
break; case "":
Console.Write (2); break; case "":
Console.Write (3); break;
}
}
Console.WriteLine ();
}
}
.
8
. . , , , Main (), static.
. -, . , 6. -, . , .
#, , : , . , . . , . .
- , .
, , , , . . , . , " 7', , .
|
|
C# : public, private, protected internal. public private. protected , , 11. internal , C# , 16.
public, , , . private, . , (private) .
6, , . private .
. , . .