Method WordWrapText
WordWrapText(string, int, bool, int, TextDirection, TextFormatter?)
Formats the provided text to fit within the width provided using word wrapping.
public static List<string> WordWrapText(string text, int width, bool preserveTrailingSpaces = false, int tabWidth = 0, TextDirection textDirection = TextDirection.LeftRight_TopBottom, TextFormatter? textFormatter = null)
Parameters
text
stringThe text to word wrap
width
intThe number of columns to constrain the text to
preserveTrailingSpaces
boolIf true trailing spaces at the end of wrapped lines will be preserved. If false , trailing spaces at the end of wrapped lines will be trimmed.
tabWidth
intThe number of columns used for a tab.
textDirection
TextDirectionThe text direction.
textFormatter
TextFormatterTextFormatter instance to access any of his objects.
Returns
Remarks
This method does not do any alignment.
This method strips Newline ('\n' and '\r\n') sequences before processing.
If preserveTrailingSpaces
is false at most one space will be preserved
at the end of the last line.