+ 1
How to shortcut Console.WriteLine(); in C# ?
The shortcut that can read any type of data. Var, string, integer, etc.
2 Respostas
+ 2
it can write any types that defines the ToString() method. this includes integer, strings, double, and many more.
these should work:
Console.WriteLine(1);
Console.WriteLine("Hello");
Console.WriteLine(1.5);
if you want a shortcut, you could define a print static method
public static void Print(object obj) {
Console.WriteLine(obj);
}
it's now a bit shorter to write.
I hope this helps :)
if I misunderstood your question, let me know!
0
Apollo-Roboto Nicee. But I need a shortcut that support blank line too :)