如何为Console.WriteLine创建快捷方式 [英] How to make a shortcut for Console.WriteLine
本文介绍了如何为Console.WriteLine创建快捷方式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我必须在代码中多次键入Console.WriteLine()。.
,所以任何人都可以告诉我为Console.WriteLine制作快捷方式,就像我可以将其用作
I have to type Console.WriteLine() many time in my code.. so can anyone tell me to make a shortcut for Console.WriteLine like i can use it as
CW=Console.WriteLine();
//After that i can use this CW for my Console.WriteLine() like
CW("Print Something");
推荐答案
Visual Studio已经为此提供了默认代码段。只需键入 cw
,然后按tab。请注意,如果您正在考虑使用一种方法,则该方法可能缺少某些功能,例如自动string.Format和其他重载参数。
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.
这篇关于如何为Console.WriteLine创建快捷方式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文