LineWrappingTextWriterForStringWriter Method

Gets a LineWrappingTextWriter that writes to a StringWriter.

Definition

Namespace: Ookii.CommandLine
Assembly: Ookii.CommandLine (in Ookii.CommandLine.dll) Version: 4.0.0+bb7ed9a8fdfd1cb21824750a8cf508863ad15086
C#
public static LineWrappingTextWriter ForStringWriter(
	int maximumLineLength = 0,
	IFormatProvider? formatProvider = null,
	bool countFormatting = false
)

Parameters

maximumLineLength  Int32  (Optional)
The maximum length of a line, in characters, or 0 to use no maximum.
formatProvider  IFormatProvider  (Optional)
An IFormatProvider that controls formatting.
countFormatting  Boolean  (Optional)
If set to , virtual terminal sequences used to format the text will not be counted as part of the line length, and will therefore not affect where the text is wrapped. The default value is .

Return Value

LineWrappingTextWriter
A LineWrappingTextWriter that writes to a StringWriter.

Remarks

To retrieve the resulting string, call the ToString method. The result will include any unflushed text without flushing that text to the BaseWriter.

See Also