Debug.Print Method

Definition

Writes a message followed by a line terminator to the trace listeners in the Listeners collection.

Overloads

Print(String)

Writes a message followed by a line terminator to the trace listeners in the Listeners collection.

Print(String, Object[])

Writes a formatted string followed by a line terminator to the trace listeners in the Listeners collection.

Print(String)

Writes a message followed by a line terminator to the trace listeners in the Listeners collection.

public:
 static void Print(System::String ^ message);
[System.Diagnostics.Conditional("DEBUG")]
public static void Print (string? message);
[System.Diagnostics.Conditional("DEBUG")]
public static void Print (string message);
[<System.Diagnostics.Conditional("DEBUG")>]
static member Print : string -> unit
Public Shared Sub Print (message As String)

Parameters

message
String

The message to write.

Attributes

Remarks

The default line terminator is a carriage return followed by a line feed. By default, the output is written to an instance of DefaultTraceListener.

Applies to

Print(String, Object[])

Writes a formatted string followed by a line terminator to the trace listeners in the Listeners collection.

public:
 static void Print(System::String ^ format, ... cli::array <System::Object ^> ^ args);
[System.Diagnostics.Conditional("DEBUG")]
public static void Print (string format, params object?[] args);
[System.Diagnostics.Conditional("DEBUG")]
public static void Print (string format, params object[] args);
[<System.Diagnostics.Conditional("DEBUG")>]
static member Print : string * obj[] -> unit
Public Shared Sub Print (format As String, ParamArray args As Object())

Parameters

format
String

A composite format string that contains text intermixed with zero or more format items, which correspond to objects in the args array.

args
Object[]

An object array containing zero or more objects to format.

Attributes

Exceptions

format is null.

format is invalid.

-or-

The number that indicates an argument to format is less than zero, or greater than or equal to the number of specified objects to format.

Remarks

This method uses .NET composite formatting feature to convert the value of an object to its text representation and embed that representation in a string. By default, the output is written to an instance of DefaultTraceListener.

See also

Applies to