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
textstringThe text to word wrap
widthintThe number of columns to constrain the text to
preserveTrailingSpacesboolIf 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.
tabWidthintThe number of columns used for a tab.
textDirectionTextDirectionThe text direction.
textFormatterTextFormatterTextFormatter 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.