TextTransformation::WriteLine Method (String^, array<Object^>^)
Appends a formatted string, which contains zero or more format specifications, and the default line terminator, to the generated text output. Each format specification is replaced by the string representation of a corresponding object argument.
Assembly: Microsoft.VisualStudio.TextTemplating.12.0 (in Microsoft.VisualStudio.TextTemplating.12.0.dll)
Parameters
- format
-
Type:
System::String^
A string that contains zero or more format specifications.
- args
-
Type:
array<System::Object^>^
An array of objects to format.
| Exception | Condition |
|---|---|
| ArgumentNullException | format is null. -or- args is null. |
| FormatException | format is invalid. |
| ArgumentOutOfRangeException | Enlarging the value of the underlying StringBuilder would exceed MaxCapacity. |
The WriteLine method can be used directly in a text template.
The following code example demonstrates calling the WriteLine method from a text template. Paste this code into any text template file and run the text template transformation to see the results.
This example produces the following output:
0: This is text to append number 0.00.
1: This is text to append number 1.00.
2: This is text to append number 2.00.
3: This is text to append number 3.00.
GenerationEnvironment
StringBuilder
AppendFormat
MaxCapacity
ArgumentOutOfRangeException
FormatException
ArgumentNullException
WriteLine Overload
TextTransformation Class
Microsoft.VisualStudio.TextTemplating Namespace
Formatting Types in the .NET Framework
Enumeration Format Strings
a316261d-41ed-49e4-9e4f-e695b982fe3e217b31cc-1e54-40ed-8e22-a293ae103d61fb83d6ff-12fd-4837-ad19-16a2515de030