C # String builder displaying data well distributed
I'm wondering how exactly can I order my date in a string device?
The value is something equal ("{0,2}", ....) to easily highlight the data.
I don't want to use console entries of any type, so the class can be reused in the form, console code, etc.
I am currently using "" for spacing, but overall it does not render correctly. (it messed up when I have digits with more than 1 digit)
public override string ToString()
{
StringBuilder builder = new StringBuilder();
foreach (int value in tabel)
{
builder.Append(value); // should have something similiar to ("{0,2}", ....)
builder.Append(" "); // should have something similiar to ("{0,2}", ....)
}
builder.Append("(top:");
builder.Append(top);
builder.Append(")");
return builder.ToString();
}/*ToString*/
Sincerely.
+2
a source to share