C # Basic Article 01

Source: Internet
Author: User

vs20vs2013 shortcut key section:

1>:

#region

#endregion (used to collapse redundant code)

2>:ctril+k+d quickly on its code;

3>:ctril+k+c Comment Check Code

Ctril+k+u uncheck Annotations

4>: F1 go to help document

5>:F12 go to the definition of the class

Transfer characters:

1 : \b Backspace

2 : \ \ denotes \ this character;

3 : \ n Enter

4 : \ r \ n is used to write a text to the Windows desktop What is used for enter, only \ n (but Mac system knows);

5 : \ t a tab stop

6 : the @ symbol function:1> cancels the function of a literal in a string, making it simple to represent a \; (for example: When writing a file path, we are accustomed to writing: string [email protected]"C:\PromgramFile\Commen\avi\XX.avi " of course, you can also write this: String Path=c:\\programfile\\commen\\avi\\xx.avi)

2> the string is exported in the original format. For example: System.writeline (@ "The weather is fine today,

Good scenery everywhere! "), so you can output line breaks, spaces, and so on.

When a valid number is retained after the decimal point: with placeholders, for example:

Double a=10;

int b=3;

Double c=a/b;

Console.WriteLine ("{0:0.00}", c); retain two decimal places;

Console.readkey ();



Unary operators have precedence over the two-tuple operator! Like + + or--it is a unary operator, and the + 、-、 *,/,% these are two-dollar operators.

Example:

int a=5;

int b=a++ + ++a*2+--a + a++;

Output a=7;b=31;





When you enter MSPaint in the Run box, the artboard is opened;

When you enter Notepad in the Run box, Notepad is opened;

When you enter write in the Run box, the WordPad is opened;

Reverse () The method and the sort () method are static methods that are called by the class name when called!!! That is, the array class. Like: Array.reverse (str), Array.Sort (number), and so on. Where Str is the string array name and number is the integer array name.



C # Basic Article 01

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.