Code with the mind

Console console (usually on the Main block in the back)
the WriteLine name (usually on the back of the console Console.WriteLine ( "Hello, Little Bitch");)
Thread.Sleep (1000); Wait a second time (you can put in the next row console <digital display is 1000 milliseconds>)
the ReadLine (in Console.ReadLine (); any key output)
the Write (Code is intended to mean line) \ n can break lines
accepts user input two integers stored in the two inside variables, the variable value stored in the exchange.
A Convert.ToInt32 = int (Console.ReadLine ());
int = B Convert.ToInt32 (Console.ReadLine ());
int Time = A; (Key)
A = B;
B = Time;
Console.WriteLine ( " . 1} {0} { ", A, B);
the Console.ReadKey ();
the Main (the While loop instruction)
the else IF (allows less stock)
can be divided into IF (to true) the else (to false)
String name = Console. the ReadLine (); (characters into an output)
IF (determination)
swich (comparison, determining a plurality of values)
for (loop looking for something to eat memory disadvantage)
&& (and) || (or)

switch (name) (comparison determination plurality of values) may be used to enumerate
{
Case "cqx":
Console.WriteLine ( "dick");
BREAK;
Case "CH":
Console.WriteLine ( "youngest");
BREAK ;
default:
Console.WriteLine ( "Please enter content serious!");
BREAK;
String [] = allName new new String [. 5] { "TianMingChao", "ChenQuanXi", "CuiHao", "RenXiang", "Luxin"};
(random codes)

the random = new new tempRand the random ();


int nameNo tempRand.Next = (0, allName.Length);
int value int.MaxValue maximum cycle
on the string:
Tolower (lowercase) toupper (capital) letters
Trim (remove spaces) TrimStart (deleted before empty) TrimEnd (after deleting empty)
Split (cut off)
Random tempRand = new new Random ();// create a random
int botNo = tempRand.Next (0, 51 ); // numerical ranges random
Array.reverse () inverted
struct structure
static member functions static methods
Math, pow mathematical
rewriting output public override string ToString () // This method is inside the attribute
{
return "Code =" Code + + ", the Name =" + + the Name ", Age = "Age +;
}
many types that can be converted Convert.ToInt32;
the int.Parse only convert numeric string.
public static Box operator + (Box b , Box c) operator overloading
generic Find Usage Var item = name.Find ((x which is a variable) => {return x == "looking for content"})
Equals (for determining and a means which is == but use different reference object Equals used to express the values are equal == whether an object is expressed)
Equals usage iF (Array [I] .Equals (Item));
the MatchCollection capture set col = capture in the character set of .Matches (characters are captured, escape character)

Guess you like

Origin www.cnblogs.com/-831/p/11230378.html