Search Results for

    Show / Hide Table of Contents

    Class StringExtensions

    Extension methods for strings.

    Inheritance
    System.Object
    StringExtensions
    Inherited Members
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: Dangl
    Assembly: Dangl.Common.dll
    Syntax
    public static class StringExtensions

    Methods

    | Improve this Doc View Source

    Compress(String)

    Returns the Base64 representation of the string after having applied GZip compression.

    Declaration
    public static string Compress(this string source)
    Parameters
    Type Name Description
    System.String source
    Returns
    Type Description
    System.String
    | Improve this Doc View Source

    Decompress(String)

    Decompresses a string from a Base64 GZip string.

    Declaration
    public static string Decompress(this string souce)
    Parameters
    Type Name Description
    System.String souce
    Returns
    Type Description
    System.String
    | Improve this Doc View Source

    FromBase64(String)

    Will return the plain text deoced from a Base64 string representation.

    Declaration
    public static string FromBase64(this string source)
    Parameters
    Type Name Description
    System.String source
    Returns
    Type Description
    System.String
    | Improve this Doc View Source

    Sanitize(String)

    Will replace all linebreaks with System.Environment.NewLine and remove white spaces at line ends as well as any trailing white spaces.

    Declaration
    public static string Sanitize(this string source)
    Parameters
    Type Name Description
    System.String source
    Returns
    Type Description
    System.String
    | Improve this Doc View Source

    ToBase64(String)

    Will return a Base64 representation of the string.

    Declaration
    public static string ToBase64(this string source)
    Parameters
    Type Name Description
    System.String source
    Returns
    Type Description
    System.String
    | Improve this Doc View Source

    WithMaxLength(String, Int32)

    This returns null for null input, otherwise the original string up to a max length

    Declaration
    public static string WithMaxLength(this string value, int maxLength)
    Parameters
    Type Name Description
    System.String value
    System.Int32 maxLength
    Returns
    Type Description
    System.String
    | Improve this Doc View Source

    WithoutLinebreaks(String)

    This returns null for null input, otherwise the original string with all linebreaks removed

    Declaration
    public static string WithoutLinebreaks(this string value)
    Parameters
    Type Name Description
    System.String value
    Returns
    Type Description
    System.String
    | Improve this Doc View Source

    WithoutUnprintableCharacters(String)

    This removes unprintable characters from the string.

    Declaration
    public static string WithoutUnprintableCharacters(this string value)
    Parameters
    Type Name Description
    System.String value
    Returns
    Type Description
    System.String
    • Improve this Doc
    • View Source
    In This Article
    Back to top © Dangl IT GmbH