Search Results for

    Show / Hide Table of Contents

    Class ConsoleChar

    Console character manipulation routines

    Inheritance
    object
    ConsoleChar
    Namespace: Terminaux.Base.Extensions
    Assembly: Terminaux.dll
    Syntax
    public static class ConsoleChar

    Methods

    | Edit this page View Source

    EstimateCellWidth(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)

    | Edit this page View Source

    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

    (WARNING: Indexes WILL change if there ARE VT sequences in the sentence! Carefully choose a value!)

    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

    | Edit this page View Source

    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

    | Edit this page View Source

    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

    | Edit this page View Source

    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

    | Edit this page View Source

    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

    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX