CKTIS / C#
Console.Write — write without adding a newline
Console.Write writes text to standard output without automatically ending the line. It lets you build output across several calls; Console.WriteLine additionally appends a line terminator.
Version: .NET 10; repository net10.0 and LangVersion=preview; feature versions require per-entry verification
Syntax
Console.Write(value);
Console.Write(format, arg0);Console.Write is a static method of System.Console that writes to standard output (Console.Out). Output can be redirected, for example to a file — it does not have to appear in a terminal window.
The method adds neither a line terminator nor spaces between calls. Console.WriteLine appends a line terminator. In the example, four calls produce Status: [ready] without a trailing newline.
Overloads accept values including string, char, numbers, and objects. A formatting overload, such as Console.Write("{0}", value), replaces indexed placeholders with argument values. An invalid format can cause FormatException.
Use using System; or the fully qualified name System.Console.Write. A write failure can cause IOException; account for this especially when output is redirected.
Examples
using System;
Console.Write("Status: ");
Console.Write('[');
Console.Write("ready");
Console.Write(']');Result
Status: [ready]
The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.