Table of Contents

Method ClipAndJustify

Namespace
Terminal.Gui.Text
Assembly
Terminal.Gui.dll

ClipAndJustify(string, int, Alignment, TextDirection, int, TextFormatter?, bool)

Justifies text within a specified width.

public static string ClipAndJustify(string text, int width, Alignment textAlignment, TextDirection textDirection = TextDirection.LeftRight_TopBottom, int tabWidth = 0, TextFormatter? textFormatter = null, bool preserveTabs = false)

Parameters

text string

The text to justify.

width int

The number of columns to clip the text to. Text longer than width will be clipped.

textAlignment Alignment

Alignment.

textDirection TextDirection

The text direction.

tabWidth int

The number of columns used for a tab.

textFormatter TextFormatter

TextFormatter instance to access any of his objects.

preserveTabs bool

If true tabs will be preserved, considering the spaces according to the provided TabWidth. If false, default, tabs will be replaced with spaces according to the provided TabWidth.

Returns

string

Justified and clipped text.

ClipAndJustify(string, int, bool, TextDirection, int, TextFormatter?, bool)

Justifies text within a specified width.

public static string ClipAndJustify(string text, int width, bool justify, TextDirection textDirection = TextDirection.LeftRight_TopBottom, int tabWidth = 0, TextFormatter? textFormatter = null, bool preserveTabs = false)

Parameters

text string

The text to justify.

width int

The number of columns to clip the text to. Text longer than width will be clipped.

justify bool

Justify.

textDirection TextDirection

The text direction.

tabWidth int

The number of columns used for a tab.

textFormatter TextFormatter

TextFormatter instance to access any of his objects.

preserveTabs bool

If true tabs will be preserved, considering the spaces according to the provided TabWidth. If false, default, tabs will be replaced with spaces according to the provided TabWidth.

Returns

string

Justified and clipped text.