בנימן הגלילי בנימן הגלילי - 1 year ago 136
C# Question

rename a function in C#

is there a way in C# to rename System.Console.WriteLine
so that in my C#/console/visual studio program I could write

//instead of
System.Console.WriteLine("Hello"); //??

What would this be, a class? a namespace? Do I do this in the header or inside of main?

Answer Source

Your target looks strange and there is no way to do this in c#. Alternatively you can add a method in a class and use it.

private static void printf(string value)

Note: above method works only in the class which you write the above method.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download