Hello all.
What's the different between Console.Write("H") and Console.Write('H') in C#. thanks.
:-)
Hello all.
What's the different between Console.Write("H") and Console.Write('H') in C#. thanks.
:-)
One uses a string
overload (the string "H"
), one uses a char
overload (the char 'H'
). Both output the character H
to the stream defined in Console.Out
without adding a newline.
'H' is a single character (char
) whereas "H" can have more than one character (string
).
The difference is that in the first call, you're passing a string
and in the second call, you're passing a char
. Practically speaking, those two calls are equivalent.