Console
Struct · built-in type
struct ConsoleText output to the console: stdout and stderr.
Console.WriteLine("Hello");Console.Write(42); // numbers, bool, char, enums and slices become textConsole.WriteErrorLine("warning: ...");The argument can be anything that becomes text in "x" + value: strings, string slices, numbers, bool,
char, enums, and structs with a string ToString().
Static methods
Section titled “Static methods”| Name | Description |
|---|---|
Write |
Writes value to stdout. |
WriteLine |
Writes value and a line break (\n) to stdout. |
WriteError |
Writes value to stderr. |
WriteErrorLine |
Writes value and a line break to stderr. |
static void Write(string value)Writes value to stdout.
WriteLine
Section titled “WriteLine”static void WriteLine(string value)Writes value and a line break (\n) to stdout.
static void WriteLine()Writes a line break to stdout.
WriteError
Section titled “WriteError”static void WriteError(string value)Writes value to stderr.
WriteErrorLine
Section titled “WriteErrorLine”static void WriteErrorLine(string value)Writes value and a line break to stderr.
static void WriteErrorLine()Writes a line break to stderr.