Table of Contents

Method GetWidestLineLength

Namespace
Terminal.Gui
Assembly
Terminal.Gui.dll

GetWidestLineLength(string, int)

Returns the number of columns in the widest line in the text, without word wrap, accounting for wide-glyphs (uses GetColumns(string)). text if it contains newlines.

public static int GetWidestLineLength(string text, int tabWidth = 0)

Parameters

text string

Text, may contain newlines.

tabWidth int

The number of columns used for a tab.

Returns

int

The length of the longest line.

Remarks

This API will return incorrect results if the text includes glyphs whose width is dependent on surrounding glyphs (e.g. Arabic).