Method Justify
Justify(string, int, char, TextDirection, int)
Justifies the text to fill the width provided. Space will be added between words to make the text just fit
width
. Spaces will not be added to the start or end.
public static string Justify(string text, int width, char spaceChar = ' ', TextDirection textDirection = TextDirection.LeftRight_TopBottom, int tabWidth = 0)
Parameters
text
stringwidth
intspaceChar
charCharacter to replace whitespace and pad with. For debugging purposes.
textDirection
TextDirectionThe text direction.
tabWidth
intThe number of columns used for a tab.
Returns
- string
The justified text.