ExtensionMethod.NET Home of 880 C#, Visual Basic, F# and Javascript extension methods

AppendLineFormat

Appends a formatted string and the default line terminator to to this StringBuilder instance.

Source

<Extension()>
Public Function AppendLineFormat(ByVal builder As StringBuilder, ByVal format As String, ByVal ParamArray args As Object()) As StringBuilder
	Dim value As String = String.Format(format, args)
		
	builder.AppendLine(value)

	Return builder
End Function

Example

Dim builder As StringBuilder = New StringBuilder()
builder.AppendLineFormat("File name: {0} (line: {1}, column: {2})", fileName, lineNumber, column)
builder.AppendLineFormat("Message: {0}", exception.Message)

Author: Koen Rouwhorst

Submitted on: 21 nov. 2010

Language: VB

Type: System.Text.StringBuilder

Views: 4703