System Library Common Framework
Search Results for

    *.Benchmark*,*.Tests*,*.ApiTests*,*.BaseTest*,DelegateJsonConverter,CalleeCancelledRequestException,ClientResponse,ContentType,OutputCachePolicy
    Show / Hide Table of Contents Show / Hide Table of Contents
    NamespaceSystemLibrary.Common.Framework.Extensions SystemLibrary.Common.Framework.Net.dll

    String Builder extensions

    StringBuilderExtensions

    public static class StringBuilderExtensions

    Inheritance
    object
    StringBuilderExtensions
    Examples
    Arguments
    X

    Methods

    Check if stringbuilder ends with a certain text

    public static bool EndsWith(this StringBuilder stringBuilder, string ending, bool caseInsensitive = false)

    X
    Methods arguments
    Type Name Description
    StringBuilder stringBuilder
    string ending
    bool caseInsensitive
    X
    Type Description
    bool

    True or false

    Returns a short string representation of the data through hashing and sample hashing

    If inputs length is less than or equal to 6 returns input obfuscated

    If inputs length exceeds 64 length, we hash only the start and end and create a finger print of up to 30 chars in between, avoidiing a lot of CPU for the risk of more collisions

    public static string GetCompressedId(this StringBuilder input)

    X
    Methods arguments
    Type Name Description
    StringBuilder input
    X
    Type Description
    string

    Replaces " with " and ' with a single quote within the StringBuilder

    Throws on null argument

    public static StringBuilder HtmlDecodeQuotes(this StringBuilder html, Dictionary<string, string> additionalReplacements = null)

    X
    Methods arguments
    Type Name Description
    StringBuilder html
    Dictionary<string, string> additionalReplacements
    X
    Type Description
    StringBuilder

    Replaces " with " and single quote with ' within the StringBuilder

    Throws on null argument

    public static StringBuilder HtmlEncodeQuotes(this StringBuilder html, Dictionary<string, string> additionalReplacements = null)

    X
    Methods arguments
    Type Name Description
    StringBuilder html
    Dictionary<string, string> additionalReplacements
    X
    Type Description
    StringBuilder

    Returns the index of the text within the StringBuilder

    public static int IndexOf(this StringBuilder stringBuilder, string text, bool ignoreCase = false, int start = 0)

    X
    Methods arguments
    Type Name Description
    StringBuilder stringBuilder
    string text

    The string to find

    bool ignoreCase

    if set to true it will ignore case

    int start

    The starting index.

    X
    Type Description
    int

    Int or -1 if not found

    Check if stringbuilder is not null and has content

    public static bool Is(this StringBuilder stringBuilder)

    X
    Methods arguments
    Type Name Description
    StringBuilder stringBuilder
    X
    Type Description
    bool

    True or false

    Check if stringbuilder is null or has no content

    public static bool IsNot(this StringBuilder stringBuilder)

    X
    Methods arguments
    Type Name Description
    StringBuilder stringBuilder
    X
    Type Description
    bool

    True or false

    Reduce the string builder to a fixed max length

    Does nothing if stringbuilder is null or less than or equal to the max length specified

    Remarks
    X

    Does not throw Returns null if null was input

    public static StringBuilder MaxLength(this StringBuilder stringBuilder, int maxLength)

    X
    var sb = new StringBuilder("hello world");
    sb.MaxLength(1);
    var text = sb.ToString();
    // text == "h"
    X
    Methods arguments
    Type Name Description
    StringBuilder stringBuilder
    int maxLength

    Max amount of characters to keep

    X
    Type Description
    StringBuilder

    Check if stringbuilder ends with certain texts, if so, the first ending match was removed

    public static bool TrimEnd(this StringBuilder stringBuilder, params string[] values)

    X
    Methods arguments
    Type Name Description
    StringBuilder stringBuilder
    string[] values
    X
    Type Description
    bool

    True if text was removed, else false

    }

    In This Article
    Package: nuget
    Source: github
    Website: System Library Common Framework