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");
'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.
There is no shortcut(code snippet) for Console. ReadLine() .
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With