Show / Hide Table of Contents

    Class StringUtilityExtensions

    This is an extension implementation of the most common methods on the StringUtility class.

    Inheritance
    System.Object
    StringUtilityExtensions
    Namespace: Cuemon
    Assembly: Cuemon.Core.dll
    Syntax
    public static class StringUtilityExtensions

    Methods

    | Improve this Doc

    ContainsAll(String, String[])

    Returns a value indicating whether all of the specified values occurs within the source.

    Declaration
    public static bool ContainsAll(this string source, params string[] values)
    Parameters
    Type Name Description
    System.String source

    The System.String to seek.

    System.String[] values

    The System.String sequence to search within source.

    Returns
    Type Description
    System.Boolean

    true if all of the values occurs within the source, or if value is the empty string (""); otherwise, false.

    Remarks

    This method performs an ordinal (case-insensitive and culture-insensitive) comparison. The search begins at the first character position of this string and continues through the last character position.

    | Improve this Doc

    ContainsAll(String, StringComparison, String[])

    Returns a value indicating whether all of the specified values occurs within the source.

    Declaration
    public static bool ContainsAll(this string source, StringComparison comparison, params string[] values)
    Parameters
    Type Name Description
    System.String source

    The System.String to seek.

    System.StringComparison comparison

    One of the enumeration values that specifies the rules to use in the comparison.

    System.String[] values

    The System.String sequence to search within source.

    Returns
    Type Description
    System.Boolean

    true if all of the values occurs within the source, or if value is the empty string (""); otherwise, false.

    | Improve this Doc

    ContainsAny(String, Char)

    Returns a value indicating whether the specified value occurs within the source.

    Declaration
    public static bool ContainsAny(this string source, char value)
    Parameters
    Type Name Description
    System.String source

    The System.String to seek.

    System.Char value

    The System.Char to search within source.

    Returns
    Type Description
    System.Boolean

    true if the value parameter occurs within the source, or if value is the empty string (""); otherwise, false.

    Remarks

    This method performs an ordinal (case-insensitive and culture-insensitive) comparison. The search begins at the first character position of this string and continues through the last character position.

    | Improve this Doc

    ContainsAny(String, Char, StringComparison)

    Returns a value indicating whether the specified value occurs within the source.

    Declaration
    public static bool ContainsAny(this string source, char value, StringComparison comparison)
    Parameters
    Type Name Description
    System.String source

    The System.String to seek.

    System.Char value

    The System.Char to search within source.

    System.StringComparison comparison

    One of the enumeration values that specifies the rules to use in the comparison.

    Returns
    Type Description
    System.Boolean

    true if the value parameter occurs within the source, or if value is the empty string (""); otherwise, false.

    | Improve this Doc

    ContainsAny(String, Char[])

    Returns a value indicating whether the specified values occurs within the source object.

    Declaration
    public static bool ContainsAny(this string source, params char[] values)
    Parameters
    Type Name Description
    System.String source

    The System.String to seek.

    System.Char[] values

    The System.Char sequence to search within source.

    Returns
    Type Description
    System.Boolean

    true if the values parameter occurs within the source, or if value is the empty string (""); otherwise, false.

    Remarks

    This method performs an ordinal (case-sensitive and culture-insensitive) comparison. The search begins at the first character position of this string and continues through the last character position.

    | Improve this Doc

    ContainsAny(String, String)

    Returns a value indicating whether the specified value occurs within the source.

    Declaration
    public static bool ContainsAny(this string source, string value)
    Parameters
    Type Name Description
    System.String source

    The System.String to seek.

    System.String value

    The System.String to search within source.

    Returns
    Type Description
    System.Boolean

    true if the value parameter occurs within the source, or if value is the empty string (""); otherwise, false.

    Remarks

    This method performs an ordinal (case-insensitive and culture-insensitive) comparison. The search begins at the first character position of this string and continues through the last character position.

    | Improve this Doc

    ContainsAny(String, String, StringComparison)

    Returns a value indicating whether the specified value occurs within the source.

    Declaration
    public static bool ContainsAny(this string source, string value, StringComparison comparison)
    Parameters
    Type Name Description
    System.String source

    The System.String to seek.

    System.String value

    The System.String to search within source.

    System.StringComparison comparison

    One of the enumeration values that specifies the rules to use in the comparison.

    Returns
    Type Description
    System.Boolean

    true if the value parameter occurs within the source, or if value is the empty string (""); otherwise, false.

    | Improve this Doc

    ContainsAny(String, String[])

    Returns a value indicating whether any of the specified values occurs within the source.

    Declaration
    public static bool ContainsAny(this string source, params string[] values)
    Parameters
    Type Name Description
    System.String source

    The System.String to seek.

    System.String[] values

    The System.String sequence to search within source.

    Returns
    Type Description
    System.Boolean

    true if any of the values occurs within the source, or if value is the empty string (""); otherwise, false.

    Remarks

    This method performs an ordinal (case-insensitive and culture-insensitive) comparison. The search begins at the first character position of this string and continues through the last character position.

    | Improve this Doc

    ContainsAny(String, StringComparison, Char[])

    Returns a value indicating whether the specified values occurs within the source object.

    Declaration
    public static bool ContainsAny(this string source, StringComparison comparison, params char[] values)
    Parameters
    Type Name Description
    System.String source

    The System.String to seek.

    System.StringComparison comparison

    One of the enumeration values that specifies the rules to use in the comparison.

    System.Char[] values

    The System.Char sequence to search within source.

    Returns
    Type Description
    System.Boolean

    true if the values parameter occurs within the source, or if value is the empty string (""); otherwise, false.

    | Improve this Doc

    ContainsAny(String, StringComparison, String[])

    Returns a value indicating whether any of the specified values occurs within the source.

    Declaration
    public static bool ContainsAny(this string source, StringComparison comparison, params string[] values)
    Parameters
    Type Name Description
    System.String source

    The System.String to seek.

    System.StringComparison comparison

    One of the enumeration values that specifies the rules to use in the comparison.

    System.String[] values

    The System.String sequence to search within source.

    Returns
    Type Description
    System.Boolean

    true if any of the values occurs within the source, or if value is the empty string (""); otherwise, false.

    | Improve this Doc

    Count(String, Char)

    Counts the occurrences of character in the specified source.

    Declaration
    public static int Count(this string source, char character)
    Parameters
    Type Name Description
    System.String source

    The source to count occurrences of character.

    System.Char character

    The System.Char value to count in source.

    Returns
    Type Description
    System.Int32

    The number of times the character was found in the source.

    Exceptions
    Type Condition
    System.ArgumentNullException

    source is null.

    | Improve this Doc

    EqualsAny(String, String[])

    Returns a value indicating the specified source equals one of the specified values.

    Declaration
    public static bool EqualsAny(this string source, params string[] values)
    Parameters
    Type Name Description
    System.String source

    The System.String to seek.

    System.String[] values

    The System.String sequence to search within source.

    Returns
    Type Description
    System.Boolean

    true if one the values is the same as the source; otherwise false.

    Remarks

    This method performs an ordinal (case-sensitive and culture-insensitive) comparison. The search begins at the first character position of this string and continues through the last character position.

    Exceptions
    Type Condition
    System.ArgumentNullException

    source is null - or - values is null.

    | Improve this Doc

    EqualsAny(String, StringComparison, String[])

    Returns a value indicating the specified source equals one of the specified values.

    Declaration
    public static bool EqualsAny(this string source, StringComparison comparison, params string[] values)
    Parameters
    Type Name Description
    System.String source

    The System.String to seek.

    System.StringComparison comparison

    One of the enumeration values that specifies the rules to use in the comparison.

    System.String[] values

    The System.String sequence to search within source.

    Returns
    Type Description
    System.Boolean

    true if one the values is the same as the source; otherwise false.

    Exceptions
    Type Condition
    System.ArgumentNullException

    source is null - or - values is null.

    | Improve this Doc

    Escape(String)

    Escapes the given System.String the same way as the well known JavaScrip escape() function.

    Declaration
    public static string Escape(this string value)
    Parameters
    Type Name Description
    System.String value

    The System.String to escape.

    Returns
    Type Description
    System.String

    The input value with an escaped equivalent.

    | Improve this Doc

    GetHashCode32(String)

    Computes a suitable hash code from the specified System.String value.

    Declaration
    public static int GetHashCode32(this string value)
    Parameters
    Type Name Description
    System.String value

    A System.String value.

    Returns
    Type Description
    System.Int32

    A 32-bit signed integer that is the hash code of value.

    Exceptions
    Type Condition
    System.ArgumentNullException

    value is null.

    | Improve this Doc

    IsBase64(String)

    Determines whether the specified value matches a Base64 structure.

    Declaration
    public static bool IsBase64(this string value)
    Parameters
    Type Name Description
    System.String value

    The value to test for a Base64 structure.

    Returns
    Type Description
    System.Boolean

    true if the specified value matches a Base64 structure; otherwise, false.

    Remarks

    This method will skip common Base64 structures typically used as checksums. This includes 32, 128, 160, 256, 384 and 512 bit checksums.

    | Improve this Doc

    IsBase64(String, Func<String, Boolean>)

    Determines whether the specified value matches a Base64 structure.

    Declaration
    public static bool IsBase64(this string value, Func<string, bool> predicate)
    Parameters
    Type Name Description
    System.String value

    The value to test for a Base64 structure.

    System.Func<System.String, System.Boolean> predicate

    A function delegate that provides custom rules for bypassing the Base64 structure check.

    Returns
    Type Description
    System.Boolean

    true if the specified value matches a Base64 structure; otherwise, false.

    | Improve this Doc

    IsCountableSequence(String)

    Determines whether the specified value is a sequence of countable characters (hence, characters being either incremented or decremented with the same cardinality through out the sequence).

    Declaration
    public static bool IsCountableSequence(this string value)
    Parameters
    Type Name Description
    System.String value

    The value to test for a sequence of countable characters.

    Returns
    Type Description
    System.Boolean

    true if the specified value is a sequence of countable characters (hence, characters being either incremented or decremented with the same cardinality through out the sequence); otherwise, false.

    | Improve this Doc

    IsNullOrEmpty(IEnumerable<String>)

    Determines whether a string sequence has at least one value that equals to null or empty.

    Declaration
    public static bool IsNullOrEmpty(this IEnumerable<string> values)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<System.String> values

    A string sequence in which to test for the presence of null or empty.

    Returns
    Type Description
    System.Boolean

    true if a string sequence has at least one value that equals to null or empty; otherwise, false.

    | Improve this Doc

    IsSequenceOf<T>(IEnumerable<String>)

    Determines whether the elements of the specified source is equivalent to the specified T.

    Declaration
    public static bool IsSequenceOf<T>(this IEnumerable<string> source)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<System.String> source

    A sequence in which to evaluate if a string value is equivalent to the specified T.

    Returns
    Type Description
    System.Boolean

    true if elements of the source parameter was successfully converted; otherwise false.

    Type Parameters
    Name Description
    T

    The type of the expected values contained within the sequence of source.

    | Improve this Doc

    IsSequenceOf<T>(IEnumerable<String>, Func<String, CultureInfo, Boolean>)

    Determines whether the elements of the specified source is equivalent to the specified T.

    Declaration
    public static bool IsSequenceOf<T>(this IEnumerable<string> source, Func<string, CultureInfo, bool> parser)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<System.String> source

    A sequence in which to evaluate if a string value is equivalent to the specified T.

    System.Func<System.String, System.Globalization.CultureInfo, System.Boolean> parser

    The function delegate that evaluates if the elements of source is equivalent to the specified T.

    Returns
    Type Description
    System.Boolean

    true if elements of the source parameter was successfully converted; otherwise false.

    Type Parameters
    Name Description
    T

    The type of the expected values contained within the sequence of source.

    | Improve this Doc

    IsSequenceOf<T>(IEnumerable<String>, CultureInfo)

    Determines whether the elements of the specified source is equivalent to the specified T.

    Declaration
    public static bool IsSequenceOf<T>(this IEnumerable<string> source, CultureInfo culture)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<System.String> source

    A sequence in which to evaluate if a string value is equivalent to the specified T.

    System.Globalization.CultureInfo culture

    The culture-specific formatting information to apply on the elements within source.

    Returns
    Type Description
    System.Boolean

    true if elements of the source parameter was successfully converted; otherwise false.

    Type Parameters
    Name Description
    T

    The type of the expected values contained within the sequence of source.

    | Improve this Doc

    IsSequenceOf<T>(IEnumerable<String>, CultureInfo, ITypeDescriptorContext)

    Determines whether the elements of the specified source is equivalent to the specified T.

    Declaration
    public static bool IsSequenceOf<T>(this IEnumerable<string> source, CultureInfo culture, ITypeDescriptorContext context)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<System.String> source

    A sequence in which to evaluate if a string value is equivalent to the specified T.

    System.Globalization.CultureInfo culture

    The culture-specific formatting information to apply on the elements within source.

    System.ComponentModel.ITypeDescriptorContext context

    The type-specific formatting information to apply on the elements within source.

    Returns
    Type Description
    System.Boolean

    true if elements of the source parameter was successfully converted; otherwise false.

    Type Parameters
    Name Description
    T

    The type of the expected values contained within the sequence of source.

    | Improve this Doc

    IsSequenceOf<T>(IEnumerable<String>, CultureInfo, Func<String, CultureInfo, Boolean>)

    Determines whether the elements of the specified source is equivalent to the specified T.

    Declaration
    public static bool IsSequenceOf<T>(this IEnumerable<string> source, CultureInfo culture, Func<string, CultureInfo, bool> parser)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<System.String> source

    A sequence in which to evaluate if a string value is equivalent to the specified T.

    System.Globalization.CultureInfo culture

    The culture-specific formatting information to apply on the elements within source.

    System.Func<System.String, System.Globalization.CultureInfo, System.Boolean> parser

    The function delegate that evaluates if the elements of source is equivalent to the specified T.

    Returns
    Type Description
    System.Boolean

    true if elements of the source parameter was successfully converted; otherwise false.

    Type Parameters
    Name Description
    T

    The type of the expected values contained within the sequence of source.

    | Improve this Doc

    ParseFormat(String, Int32, out Int32)

    Parses the given string for any format arguments (eg. Text{0}-{1}.).

    Declaration
    public static bool ParseFormat(this string format, int maxArguments, out int foundArguments)
    Parameters
    Type Name Description
    System.String format

    The desired string format to parse.

    System.Int32 maxArguments

    The maximum allowed arguments in the string format.

    System.Int32 foundArguments

    The number of arguments found in the string format.

    Returns
    Type Description
    System.Boolean

    true if one or more format arguments is found and the found arguments does not exceed the maxArguments parameter; otherwise false.

    | Improve this Doc

    ParseFormat(String, out Int32)

    Parses the given string for any format arguments (eg. Text{0}-{1}.).

    Declaration
    public static bool ParseFormat(this string format, out int foundArguments)
    Parameters
    Type Name Description
    System.String format

    The desired string format to parse.

    System.Int32 foundArguments

    The number of arguments found in the string format.

    Returns
    Type Description
    System.Boolean

    true if one or more format arguments is found; otherwise false.

    | Improve this Doc

    RemoveAll(String, Char[])

    Returns a new string in which all the specified filter values has been deleted from the specified source.

    Declaration
    public static string RemoveAll(this string source, params char[] filter)
    Parameters
    Type Name Description
    System.String source

    The source to delete occurrences found in filter.

    System.Char[] filter

    The filter containing the characters and/or words to delete.

    Returns
    Type Description
    System.String

    A new string that is equivalent to source except for the removed characters.

    | Improve this Doc

    RemoveAll(String, String[])

    Returns a new string in which all the specified filter values has been deleted from the specified source.

    Declaration
    public static string RemoveAll(this string source, params string[] filter)
    Parameters
    Type Name Description
    System.String source

    The source to delete occurrences found in filter.

    System.String[] filter

    The filter containing the characters and/or words to delete.

    Returns
    Type Description
    System.String

    A new string that is equivalent to source except for the removed characters and/or words.

    Remarks

    This method performs an ordinal (case-sensitive and culture-insensitive) comparison. The search begins at the first character position of this string and continues through the last character position.

    Exceptions
    Type Condition
    System.ArgumentNullException

    source is null or filter is null.

    | Improve this Doc

    RemoveAll(String, StringComparison, String[])

    Returns a new string in which all the specified filter values has been deleted from the specified source.

    Declaration
    public static string RemoveAll(this string source, StringComparison comparison, params string[] filter)
    Parameters
    Type Name Description
    System.String source

    The source to delete occurrences found in filter.

    System.StringComparison comparison

    One of the enumeration values that specifies the rules to use in the comparison.

    System.String[] filter

    The filter containing the characters and/or words to delete.

    Returns
    Type Description
    System.String

    A new string that is equivalent to source except for the removed characters and/or words.

    Exceptions
    Type Condition
    System.ArgumentNullException

    source is null or filter is null.

    | Improve this Doc

    RemoveAll(String[], String[])

    Returns a new string array in which all the specified filter values has been deleted from the specified source array.

    Declaration
    public static string[] RemoveAll(this string[] source, params string[] filter)
    Parameters
    Type Name Description
    System.String[] source

    The source array to delete occurrences found in filter.

    System.String[] filter

    The filter containing the characters and/or words to delete.

    Returns
    Type Description
    System.String[]

    A new string array that is equivalent to source except for the removed characters and/or words.

    Remarks

    This method performs an ordinal (case-sensitive and culture-insensitive) comparison. The search begins at the first character position of this string and continues through the last character position.

    Exceptions
    Type Condition
    System.ArgumentNullException

    source is null or filter is null.

    | Improve this Doc

    RemoveAll(String[], StringComparison, String[])

    Returns a new string array in which all the specified filter values has been deleted from the specified source array.

    Declaration
    public static string[] RemoveAll(this string[] source, StringComparison comparison, params string[] filter)
    Parameters
    Type Name Description
    System.String[] source

    The source array to delete occurrences found in filter.

    System.StringComparison comparison

    One of the enumeration values that specifies the rules to use in the comparison.

    System.String[] filter

    The filter containing the characters and/or words to delete.

    Returns
    Type Description
    System.String[]

    A new string array that is equivalent to source except for the removed characters and/or words.

    Exceptions
    Type Condition
    System.ArgumentNullException

    source is null or filter is null.

    | Improve this Doc

    ReplaceAll(String, IEnumerable<StringReplacePair>, StringComparison)

    Replaces all occurrences of the OldValue with NewValue of the replacePairs sequence in value.

    Declaration
    public static string ReplaceAll(this string value, IEnumerable<StringReplacePair> replacePairs, StringComparison comparison)
    Parameters
    Type Name Description
    System.String value

    The System.String value to perform the replacement on.

    System.Collections.Generic.IEnumerable<StringReplacePair> replacePairs

    A sequence of StringReplacePair values.

    System.StringComparison comparison

    One of the enumeration values that specifies the rules to use in the comparison.

    Returns
    Type Description
    System.String

    A System.String equivalent to value but with all instances of OldValue replaced with NewValue.

    | Improve this Doc

    ReplaceAll(String, String, String)

    Replaces all occurrences of oldValue in value, with newValue.

    Declaration
    public static string ReplaceAll(this string value, string oldValue, string newValue)
    Parameters
    Type Name Description
    System.String value

    The System.String value to perform the replacement on.

    System.String oldValue

    The System.String value to be replaced.

    System.String newValue

    The System.String value to replace all occurrences of oldValue.

    Returns
    Type Description
    System.String

    A System.String equivalent to value but with all instances of oldValue replaced with newValue.

    Remarks

    This method performs an System.StringComparison.OrdinalIgnoreCase search to find oldValue.

    | Improve this Doc

    ReplaceAll(String, String, String, StringComparison)

    Replaces all occurrences of oldValue in value, with newValue.

    Declaration
    public static string ReplaceAll(this string value, string oldValue, string newValue, StringComparison comparison)
    Parameters
    Type Name Description
    System.String value

    The System.String value to perform the replacement on.

    System.String oldValue

    The System.String value to be replaced.

    System.String newValue

    The System.String value to replace all occurrences of oldValue.

    System.StringComparison comparison

    One of the enumeration values that specifies the rules to use in the comparison.

    Returns
    Type Description
    System.String

    A System.String equivalent to value but with all instances of oldValue replaced with newValue.

    | Improve this Doc

    Shuffle(IEnumerable<String>)

    Shuffles the specified values like a deck of cards.

    Declaration
    public static string Shuffle(this IEnumerable<string> values)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<System.String> values

    The values to be shuffled in the randomization process.

    Returns
    Type Description
    System.String

    A random string from the shuffled values provided.

    Exceptions
    Type Condition
    System.ArgumentNullException

    values is null.

    System.ArgumentOutOfRangeException

    values is empty.

    | Improve this Doc

    Split(String)

    Returns a string array that contains the substrings of value that are delimited by a comma (",").

    Declaration
    public static string[] Split(this string value)
    Parameters
    Type Name Description
    System.String value

    The value containing substrings and delimiters.

    Returns
    Type Description
    System.String[]

    An array whose elements contain the substrings of value that are delimited by a comma (",").

    Remarks

    The following table shows the default values for the overloads of this method.

    ParameterDefault Value
    delimiter,
    textQualifier"
    providerSystem.Globalization.CultureInfo.InvariantCulture
    | Improve this Doc

    Split(String, String)

    Returns a string array that contains the substrings of value that are delimited by delimiter.

    Declaration
    public static string[] Split(this string value, string delimiter)
    Parameters
    Type Name Description
    System.String value

    The value containing substrings and delimiters.

    System.String delimiter

    The delimiter specification.

    Returns
    Type Description
    System.String[]

    An array whose elements contain the substrings of value that are delimited by delimiter.

    | Improve this Doc

    Split(String, String, String)

    Returns a string array that contains the substrings of value that are delimited by delimiter. A parameter specifies the textQualifier that surrounds a field.

    Declaration
    public static string[] Split(this string value, string delimiter, string textQualifier)
    Parameters
    Type Name Description
    System.String value

    The value containing substrings and delimiters.

    System.String delimiter

    The delimiter specification.

    System.String textQualifier

    The text qualifier specification that surrounds a field.

    Returns
    Type Description
    System.String[]

    An array whose elements contain the substrings of value that are delimited by delimiter.

    | Improve this Doc

    StartsWith(String, IEnumerable<String>)

    Determines whether the beginning of an instance of System.String matches at least one string in the specified sequence of strings.

    Declaration
    public static bool StartsWith(this string value, IEnumerable<string> startWithValues)
    Parameters
    Type Name Description
    System.String value

    The System.String to compare.

    System.Collections.Generic.IEnumerable<System.String> startWithValues

    A sequence of System.String values to match against.

    Returns
    Type Description
    System.Boolean

    true if at least one value matches the beginning of this string; otherwise, false.

    Remarks

    This match is performed by using a default value of System.StringComparison.OrdinalIgnoreCase.

    | Improve this Doc

    StartsWith(String, String[])

    Determines whether the beginning of an instance of System.String matches at least one string in the specified sequence of strings.

    Declaration
    public static bool StartsWith(this string value, params string[] startWithValues)
    Parameters
    Type Name Description
    System.String value

    The System.String to compare.

    System.String[] startWithValues

    A sequence of System.String values to match against.

    Returns
    Type Description
    System.Boolean

    true if at least one value matches the beginning of this string; otherwise, false.

    Remarks

    This match is performed by using a default value of System.StringComparison.OrdinalIgnoreCase.

    | Improve this Doc

    StartsWith(String, StringComparison, IEnumerable<String>)

    Determines whether the beginning of an instance of System.String matches at least one string in the specified sequence of strings.

    Declaration
    public static bool StartsWith(this string value, StringComparison comparison, IEnumerable<string> startWithValues)
    Parameters
    Type Name Description
    System.String value

    The System.String to compare.

    System.StringComparison comparison

    One of the enumeration values that specifies the rules to use in the comparison.

    System.Collections.Generic.IEnumerable<System.String> startWithValues

    A sequence of System.String values to match against.

    Returns
    Type Description
    System.Boolean

    true if at least one value matches the beginning of this string; otherwise, false.

    | Improve this Doc

    StartsWith(String, StringComparison, String[])

    Determines whether the beginning of an instance of System.String matches at least one string in the specified sequence of strings.

    Declaration
    public static bool StartsWith(this string value, StringComparison comparison, params string[] startWithValues)
    Parameters
    Type Name Description
    System.String value

    The System.String to compare.

    System.StringComparison comparison

    One of the enumeration values that specifies the rules to use in the comparison.

    System.String[] startWithValues

    A sequence of System.String values to match against.

    Returns
    Type Description
    System.Boolean

    true if at least one value matches the beginning of this string; otherwise, false.

    Remarks

    This match is performed by using a default value of System.StringComparison.OrdinalIgnoreCase.

    | Improve this Doc

    TrimAll(String)

    Removes all occurrences of white-space characters from the specified value.

    Declaration
    public static string TrimAll(this string value)
    Parameters
    Type Name Description
    System.String value

    A System.String value.

    Returns
    Type Description
    System.String

    The string that remains after all occurrences of white-space characters are removed from the specified value.

    | Improve this Doc

    TrimAll(String, Char[])

    Removes all occurrences of a set of characters specified in trimChars from the specified value.

    Declaration
    public static string TrimAll(this string value, params char[] trimChars)
    Parameters
    Type Name Description
    System.String value

    A System.String value.

    System.Char[] trimChars

    An array of Unicode characters to remove.

    Returns
    Type Description
    System.String

    The string that remains after all occurrences of the characters in the trimChars parameter are removed from the specified value.

    Exceptions
    Type Condition
    System.ArgumentNullException

    value is null.

    | Improve this Doc

    Unescape(String)

    Unescapes the given System.String the same way as the well known Javascript unescape() function.

    Declaration
    public static string Unescape(this string value)
    Parameters
    Type Name Description
    System.String value

    The System.String to unescape.

    Returns
    Type Description
    System.String

    The input value with an unescaped equivalent.

    • Improve this Doc
    • View Source
    Back to top Copyright 2008-2018 Weubphoria. All rights reserved.
    Generated by DocFX