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.Wr
You could declare a static method to wrap the call:
static class C
{
static void W(string s)
{
Console.WriteLine(s);
}
}
then:
C.W("Print Something");
I would be inclined to use the "inline method" refactoring before checking in any code that calls this method. As Jon Skeet notes, it's less confusing simply to use Console.WriteLine directly.