unforutantely, you'll have to make your own.
To make right-alignment, use the PadLeft() method.
Code:
public static string LeftAlign(string text, int widthOfLine)
{
return text.PadRight(' ', widthOfLine);
}
public static string RightAlign(string text, int widthOfLine)
{
return text.PadLeft(' ', widthOfLine);
}
To centre text, find the width of the text, and do Math.Floor( ( (width_of_line - width_of_text) ) / 2 ) to get the position to start at.
E.g
Code:
private string CentreText(string text, int widthOfLine)
{
int startPosition = (int)Math.Floor((widthOfLine - text.Length)/2));
StringBuilder blankLine = new StringBuilder( new string(' ', widthOfLine) );
blankLine.Insert(startPosition, text);
return blankLine.ToString();
}
I hope this helps,
Dom