Appends the specified string to the current instance, with the
format specifications in that string being replaced with the appropriately formatted string values of
the elements in the specified array.
[Edit]
Parameters
- format
- A string containing zero or more format specifications.
[Edit]
- args
- A object array to be formatted.
[Edit]
Returns
The current instance after
operation has occurred.
[Edit]
Exceptions
Remarks
Example
C# Example |
using System;
using System.Text;
public class StringBuilderTest {
public static void Main() {
string [] strings = {"very", "very", null, "high"};
StringBuilder sb = new StringBuilder("The high ");
Console.WriteLine( sb.AppendFormat("temperature today was {0}, {1} {2}{3}.", strings) );
}
}
|
The output is
The high
temperature today was very, very high.
Requirements
Namespace: System.Text
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0