Class ConsoleChar
Console character manipulation routines
Inheritance
Namespace: Terminaux.Base.Extensions
Assembly: Terminaux.dll
Syntax
public static class ConsoleChar
Methods
| Edit this page View SourceEstimateCellWidth(string)
Estimates the cell width (how many cells a string takes up)
Declaration
public static int EstimateCellWidth(string sentence)
Parameters
Type | Name | Description |
---|---|---|
string | sentence | A sentence to process |
Returns
Type | Description |
---|---|
int | Length of the string by character widths (a.k.a. how many cells this sentence takes up) |
EstimateCellWidth(string, int, bool)
Estimates the cell width (how many cells a string takes up) of a character
Declaration
public static int EstimateCellWidth(string sentence, int index, bool processed = false)
Parameters
Type | Name | Description |
---|---|---|
string | sentence | A sentence to process |
int | index | Index of a character within a sentence |
bool | processed | Whether to process the sentence
|
Returns
Type | Description |
---|---|
int | Length of a character by character widths (a.k.a. how many cells this sentence takes up), or -1 if empty |
EstimateFullWidths(string)
Estimates the amount of zero-width characters
Declaration
public static int EstimateFullWidths(string sentence)
Parameters
Type | Name | Description |
---|---|---|
string | sentence | A sentence to process |
Returns
Type | Description |
---|---|
int | The amount of zero-width characters that this sentence contains |
EstimateZeroWidths(string)
Estimates the amount of zero-width characters
Declaration
public static int EstimateZeroWidths(string sentence)
Parameters
Type | Name | Description |
---|---|---|
string | sentence | A sentence to process |
Returns
Type | Description |
---|---|
int | The amount of zero-width characters that this sentence contains |
GetWideChars(string)
Gets a list of wide characters from a sentence
Declaration
public static WideChar[] GetWideChars(string sentence)
Parameters
Type | Name | Description |
---|---|---|
string | sentence | Sentence to form |
Returns
Type | Description |
---|---|
WideChar[] | Wide character instances |
GetWidth(WideChar)
Gets the cell width for this character
Declaration
public static int GetWidth(this WideChar wideChar)
Parameters
Type | Name | Description |
---|---|---|
WideChar | wideChar |
Returns
Type | Description |
---|---|
int | Width of the character |