Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Make a shortcut for Console.WriteLine()

Tags:

c#

.net

I have to type Console.WriteLine() many times in my code. Is it possible to create a shortcut for Console.WriteLine so that I can use it like...

CW=Console.WriteLine(); // After that, I can use this CW for my Console.WriteLine() like CW("Print Something"); 
like image 709
Kishore Kumar Avatar asked Mar 08 '12 06:03

Kishore Kumar


People also ask

What is the shortcut for console WriteLine?

'cw' is the code snippet for Console. WriteLine() . So, if you just type 'cw' and press TAB key twice, it will automatically type the “Console. WriteLine()” and the cursor will be placed in between the braces so that you can continue your typing with out any interruption.

What is the shortcut for console ReadLine in C#?

There is no shortcut(code snippet) for Console. ReadLine() .

What is console WriteLine () in C#?

WriteLine(String, Object, Object) Writes the text representation of the specified objects, followed by the current line terminator, to the standard output stream using the specified format information.

How do you write to console in C sharp?

In C# you can write or print to console using Console. WriteLine() or Console. Write(), basically both methods are used to print output of console.


1 Answers

Visual Studio already has a default code snippet for this. Just type cw and press tab. Note that if you're considering using a method, it may lack some features like the automatic string.Format and other overloaded parameters.

like image 55
Chibueze Opata Avatar answered Oct 04 '22 06:10

Chibueze Opata