Search Results for

    Show / Hide Table of Contents

    Class StringIncludingTerminatorComparer

    An implementation of for System.String, which compares string taking into account the fact that the string may contain (at any index, not necessarily at then end) a special char, called terminator, which has to be considered smaller than any other char.

    Inheritance
    System.Object
    StringIncludingTerminatorComparer
    Namespace: MoreStructures.Utilities
    Assembly: MoreStructures.dll
    Syntax
    public class StringIncludingTerminatorComparer : IComparer<string>

    Properties

    | Improve this Doc View Source

    Terminator

    The character acting as terminator, and which has to be considered smaller than any other char.

    Declaration
    public char Terminator { get; }
    Property Value
    Type Description
    System.Char

    Methods

    | Improve this Doc View Source

    Build(Char)

    Builds a StringIncludingTerminatorComparer with the provided terminator. Caches instances.

    Declaration
    public static StringIncludingTerminatorComparer Build(char terminator)
    Parameters
    Type Name Description
    System.Char terminator

    Returns
    Type Description
    StringIncludingTerminatorComparer

    An instance of StringIncludingTerminatorComparer, new or previously created and cached.

    | Improve this Doc View Source

    Compare(String, String)

    Declaration
    public int Compare(string x, string y)
    Parameters
    Type Name Description
    System.String x
    System.String y
    Returns
    Type Description
    System.Int32
    Remarks

    Special rules applied by StringIncludingTerminatorComparer:

    • If either string is null or empty, the standard System.String.Compare(System.String,System.String) is used.
    • If one string starts with the terminator, and the other doesn't, the one which does is smaller.
    • If none of the cases above applies, System.String.Compare(System.String,System.String) is used on the substring starting from index 1 of each of the strings x and y.

    Extension Methods

    SuffixStructureNodeExtensions.GetAllSuffixesFor<TEdge, TNode>(TNode, TextWithTerminator)
    • Improve this Doc
    • View Source
    In This Article
    Back to top Generated by DocFX