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 printf("hello"); //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? 回答1: 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) { System.Console.WriteLine(value); } Note: above