Show / Hide Table of Contents

    Class StringConverter

    This utility class is designed to make System.String related conversions easier to work with.

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

    Methods

    | Improve this Doc

    FromBytes(Byte[], Action<EncodingOptions>)

    Converts the specified value to a string using the provided preferred encoding.

    Declaration
    public static string FromBytes(byte[] value, Action<EncodingOptions> setup = null)
    Parameters
    Type Name Description
    System.Byte[] value

    The byte array to be converted.

    System.Action<EncodingOptions> setup

    The EncodingOptions which need to be configured.

    Returns
    Type Description
    System.String

    A System.String containing the results of decoding the specified sequence of bytes.

    Remarks

    EncodingOptions will be initialized with DefaultPreambleSequence and DefaultEncoding.

    | Improve this Doc

    FromChars(IEnumerable<Char>)

    Converts the specified value to its equivalent System.String representation.

    Declaration
    public static string FromChars(IEnumerable<char> value)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<System.Char> value

    The System.Char sequence to convert.

    Returns
    Type Description
    System.String

    A System.String equivalent to the specified value.

    | Improve this Doc

    FromException(Exception)

    Renders the exception to a human readable System.String.

    Declaration
    public static string FromException(Exception exception)
    Parameters
    Type Name Description
    System.Exception exception

    The System.Exception to render human readable.

    Returns
    Type Description
    System.String

    A human readable System.String variant of the specified exception.

    Remarks

    The rendered exception defaults to using an instance of System.Text.Encoding.Unicode unless specified otherwise.

    | Improve this Doc

    FromException(Exception, Encoding)

    Renders the exception to a human readable System.String.

    Declaration
    public static string FromException(Exception exception, Encoding encoding)
    Parameters
    Type Name Description
    System.Exception exception

    The System.Exception to render human readable.

    System.Text.Encoding encoding

    The encoding to use when rendering the exception.

    Returns
    Type Description
    System.String

    A human readable System.String variant of the specified exception.

    | Improve this Doc

    FromException(Exception, Encoding, Boolean)

    Renders the exception to a human readable System.String.

    Declaration
    public static string FromException(Exception exception, Encoding encoding, bool includeStackTrace)
    Parameters
    Type Name Description
    System.Exception exception

    The System.Exception to render human readable.

    System.Text.Encoding encoding

    The encoding to use when rendering the exception.

    System.Boolean includeStackTrace

    if set to true the stack trace of the exception is included in the rendered result.

    Returns
    Type Description
    System.String

    A human readable System.String variant of the specified exception.

    | Improve this Doc

    FromHexadecimal(String, Action<EncodingOptions>)

    Converts the specified hexadecimal hexadecimalValue to its equivalent System.String representation.

    Declaration
    public static string FromHexadecimal(string hexadecimalValue, Action<EncodingOptions> setup = null)
    Parameters
    Type Name Description
    System.String hexadecimalValue

    The hexadecimal string to be converted.

    System.Action<EncodingOptions> setup

    The EncodingOptions which need to be configured.

    Returns
    Type Description
    System.String

    A System.String representation of the hexadecimal characters in hexadecimalValue.

    Remarks

    EncodingOptions will be initialized with DefaultPreambleSequence and DefaultEncoding.

    Exceptions
    Type Condition
    System.ArgumentNullException

    hexadecimalValue is null.

    | Improve this Doc

    FromObject(Object)

    Returns a System.String that represents the specified instance.

    Declaration
    public static string FromObject(object instance)
    Parameters
    Type Name Description
    System.Object instance

    The instance to represent.

    Returns
    Type Description
    System.String

    A System.String that represents the specified instance.

    Remarks

    When determining the representation of the specified instance, these rules applies:
    1: if the System.Object.ToString() method has been overridden, any further processing is skipped
    2: any public properties having index parameters is skipped
    3: any public properties is appended to the result if System.Object.ToString() has not been overridden.

    Note: do not call this method from an overridden ToString(..) method as a stackoverflow exception will occur.

    | Improve this Doc

    FromObject(Object, Boolean)

    Returns a System.String that represents the specified instance.

    Declaration
    public static string FromObject(object instance, bool bypassOverrideCheck)
    Parameters
    Type Name Description
    System.Object instance

    The instance to represent.

    System.Boolean bypassOverrideCheck

    Specify true to bypass the check for if a ToString() method is overridden; otherwise, false to use default behavior, where an overridden method will return without further processing.

    Returns
    Type Description
    System.String

    A System.String that represents the specified instance.

    Remarks

    When determining the representation of the specified instance, these rules applies:
    1: if the System.Object.ToString() method has been overridden, any further processing is skipped
    2: any public properties having index parameters is skipped
    3: any public properties is appended to the result if System.Object.ToString() has not been overridden.

    Note: do not call this method from an overridden ToString(..) method without setting bypassOverrideCheck to true; otherwise a stackoverflow exception will occur.

    | Improve this Doc

    FromObject(Object, Boolean, IFormatProvider)

    Returns a System.String that represents the specified instance.

    Declaration
    public static string FromObject(object instance, bool bypassOverrideCheck, IFormatProvider provider)
    Parameters
    Type Name Description
    System.Object instance

    The instance to represent.

    System.Boolean bypassOverrideCheck

    Specify true to bypass the check for if a ToString() method is overriden; otherwise, false to use default behaviour, where an overriden method will return without further processing.

    System.IFormatProvider provider

    An object that supplies culture-specific formatting information.

    Returns
    Type Description
    System.String

    A System.String that represents the specified instance.

    Remarks

    When determining the representation of the specified instance, these rules applies:
    1: if the System.Object.ToString() method has been overridden, any further processing is skipped
    2: any public properties having index parameters is skipped
    3: any public properties is appended to the result if System.Object.ToString() has not been overridden.

    Note: do not call this method from an overridden ToString(..) method without setting bypassOverrideCheck to true; otherwise a stackoverflow exception will occur.

    | Improve this Doc

    FromObject(Object, Boolean, IFormatProvider, String)

    Returns a System.String that represents the specified instance.

    Declaration
    public static string FromObject(object instance, bool bypassOverrideCheck, IFormatProvider provider, string delimiter)
    Parameters
    Type Name Description
    System.Object instance

    The instance to represent.

    System.Boolean bypassOverrideCheck

    Specify true to bypass the check for if a ToString() method is overriden; otherwise, false to use default behaviour, where an overriden method will return without further processing.

    System.IFormatProvider provider

    An object that supplies culture-specific formatting information.

    System.String delimiter

    The delimiter specification for when representing public properties of instance.

    Returns
    Type Description
    System.String

    A System.String that represents the specified instance.

    Remarks

    When determining the representation of the specified instance, these rules applies:
    1: if the System.Object.ToString() method has been overridden, any further processing is skipped
    2: any public properties having index parameters is skipped
    3: any public properties is appended to the result if System.Object.ToString() has not been overridden.

    Note: do not call this method from an overridden ToString(..) method without setting bypassOverrideCheck to true; otherwise a stackoverflow exception will occur.

    | Improve this Doc

    FromObject(Object, Boolean, IFormatProvider, String, Func<PropertyInfo, Object, IFormatProvider, String>)

    Returns a System.String that represents the specified instance.

    Declaration
    public static string FromObject(object instance, bool bypassOverrideCheck, IFormatProvider provider, string delimiter, Func<PropertyInfo, object, IFormatProvider, string> propertyConverter)
    Parameters
    Type Name Description
    System.Object instance

    The instance to represent.

    System.Boolean bypassOverrideCheck

    Specify true to bypass the check for if a ToString() method is overriden; otherwise, false to use default behaviour, where an overriden method will return without further processing.

    System.IFormatProvider provider

    An object that supplies culture-specific formatting information.

    System.String delimiter

    The delimiter specification for when representing public properties of instance.

    System.Func<System.Reflection.PropertyInfo, System.Object, System.IFormatProvider, System.String> propertyConverter

    The function delegate that convert System.Reflection.PropertyInfo objects to human-readable content.

    Returns
    Type Description
    System.String

    A System.String that represents the specified instance.

    Remarks

    When determining the representation of the specified instance, these rules applies:
    1: if the System.Object.ToString() method has been overridden, any further processing is skipped
    2: any public properties having index parameters is skipped
    3: any public properties is appended to the result if System.Object.ToString() has not been overridden.

    Note: do not call this method from an overridden ToString(..) method without setting bypassOverrideCheck to true; otherwise a stackoverflow exception will occur.

    | Improve this Doc

    FromObject(Object, Boolean, IFormatProvider, String, Func<PropertyInfo, Object, IFormatProvider, String>, Func<Type, BindingFlags, IEnumerable<PropertyInfo>>, BindingFlags)

    Returns a System.String that represents the specified instance.

    Declaration
    public static string FromObject(object instance, bool bypassOverrideCheck, IFormatProvider provider, string delimiter, Func<PropertyInfo, object, IFormatProvider, string> propertyConverter, Func<Type, BindingFlags, IEnumerable<PropertyInfo>> propertiesReader, BindingFlags propertiesReaderBindingAttr)
    Parameters
    Type Name Description
    System.Object instance

    The instance to represent.

    System.Boolean bypassOverrideCheck

    Specify true to bypass the check for if a ToString() method is overriden; otherwise, false to use default behaviour, where an overriden method will return without further processing.

    System.IFormatProvider provider

    An object that supplies culture-specific formatting information.

    System.String delimiter

    The delimiter specification for when representing public properties of instance.

    System.Func<System.Reflection.PropertyInfo, System.Object, System.IFormatProvider, System.String> propertyConverter

    The function delegate that convert System.Reflection.PropertyInfo objects to human-readable content.

    System.Func<System.Type, System.Reflection.BindingFlags, System.Collections.Generic.IEnumerable<System.Reflection.PropertyInfo>> propertiesReader

    The function delegate that read System.Reflection.PropertyInfo objects from the underlying System.Type of instance.

    System.Reflection.BindingFlags propertiesReaderBindingAttr

    A bitmask comprised of one or more System.Reflection.BindingFlags that specify how the search for System.Reflection.PropertyInfo objects in the function delegate propertiesReader is conducted.

    Returns
    Type Description
    System.String

    A System.String that represents the specified instance.

    Remarks

    When determining the representation of the specified instance, these rules applies:
    1: if the System.Object.ToString() method has been overridden, any further processing is skipped
    2: any public properties having index parameters is skipped
    3: any public properties is appended to the result if System.Object.ToString() has not been overridden.

    Note: do not call this method from an overridden ToString(..) method without setting bypassOverrideCheck to true; otherwise a stackoverflow exception will occur.

    | Improve this Doc

    FromPascalCasing(String, String)

    Converts the specified pascal-case representation value to a human readable string.

    Declaration
    public static string FromPascalCasing(string value, string delimiter = " ")
    Parameters
    Type Name Description
    System.String value

    The System.String to convert.

    System.String delimiter

    The delimiter to use when converting PascalCasing to a human readable string. Default is space ( ).

    Returns
    Type Description
    System.String

    A human readable string from the specified pascal-case representation value.

    | Improve this Doc

    FromStream(Stream, Action<EncodingOptions>)

    Converts the specified value to a string using the provided preferred encoding.

    Declaration
    public static string FromStream(Stream value, Action<EncodingOptions> setup = null)
    Parameters
    Type Name Description
    System.IO.Stream value

    The System.IO.Stream to be converted.

    System.Action<EncodingOptions> setup

    The EncodingOptions which need to be configured.

    Returns
    Type Description
    System.String

    A System.String containing the decoded result of the specified value.

    Remarks

    EncodingOptions will be initialized with DefaultPreambleSequence and DefaultEncoding.

    | Improve this Doc

    FromStream(Stream, Action<EncodingOptions>, Boolean)

    Converts the specified value to a string using the provided preferred encoding.

    Declaration
    public static string FromStream(Stream value, Action<EncodingOptions> setup, bool leaveStreamOpen)
    Parameters
    Type Name Description
    System.IO.Stream value

    The System.IO.Stream to be converted.

    System.Action<EncodingOptions> setup

    The EncodingOptions which need to be configured.

    System.Boolean leaveStreamOpen

    if true, the System.IO.Stream object is being left open; otherwise it is being closed and disposed.

    Returns
    Type Description
    System.String

    A System.String containing the decoded result of the specified value.

    Remarks

    EncodingOptions will be initialized with DefaultPreambleSequence and DefaultEncoding.

    | Improve this Doc

    FromType(Type)

    Converts the name of the source with the intend to be understood by humans.

    Declaration
    public static string FromType(Type source)
    Parameters
    Type Name Description
    System.Type source

    The type to sanitize the name from.

    Returns
    Type Description
    System.String

    A sanitized System.String representation of source.

    Remarks

    Only the simple name of the source is returned, not the fully qualified name.

    | Improve this Doc

    FromType(Type, Boolean)

    Converts the name of the source with the intend to be understood by humans.

    Declaration
    public static string FromType(Type source, bool fullName)
    Parameters
    Type Name Description
    System.Type source

    The type to sanitize the name from.

    System.Boolean fullName

    Specify true to use the fully qualified name of the source; otherwise, false for the simple name of source.

    Returns
    Type Description
    System.String

    A sanitized System.String representation of source.

    | Improve this Doc

    FromType(Type, Boolean, Boolean)

    Converts the name of the source with the intend to be understood by humans.

    Declaration
    public static string FromType(Type source, bool fullName, bool excludeGenericArguments)
    Parameters
    Type Name Description
    System.Type source

    The type to sanitize the name from.

    System.Boolean fullName

    Specify true to use the fully qualified name of the source; otherwise, false for the simple name of source.

    System.Boolean excludeGenericArguments

    Specify true to exclude generic arguments from the result; otherwise false to include generic arguments should the source be a generic type.

    Returns
    Type Description
    System.String

    A sanitized System.String representation of source.

    | Improve this Doc

    FromUriScheme(UriScheme)

    Converts the specified string representation of an URI scheme to its UriScheme equivalent.

    Declaration
    public static string FromUriScheme(UriScheme uriScheme)
    Parameters
    Type Name Description
    UriScheme uriScheme

    A string containing an URI scheme to convert.

    Returns
    Type Description
    System.String

    An UriScheme equivalent to the specified uriScheme or Undefined if a conversion is not possible.

    | Improve this Doc

    ToBinary(Byte[])

    Converts the specified value to its equivalent binary representation.

    Declaration
    public static string ToBinary(byte[] value)
    Parameters
    Type Name Description
    System.Byte[] value

    The byte array to be converted.

    Returns
    Type Description
    System.String

    A binary System.String representation of the elements in value.

    Exceptions
    Type Condition
    System.ArgumentNullException

    value is null.

    | Improve this Doc

    ToCamelCasing(String)

    Converts the specified value to a camel-case representation, using culture-independent casing rules.

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

    The System.String value to convert.

    Returns
    Type Description
    System.String

    A camel-case representation of the specified System.String value.

    | Improve this Doc

    ToDelimitedString<T>(IEnumerable<T>)

    Converts the specified source to a string of comma delimited values.

    Declaration
    public static string ToDelimitedString<T>(IEnumerable<T> source)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<T> source

    A collection of values to be converted.

    Returns
    Type Description
    System.String

    A System.String of comma delimited values.

    Type Parameters
    Name Description
    T

    The type of the source to convert.

    | Improve this Doc

    ToDelimitedString<TSource>(IEnumerable<TSource>, String)

    Converts the specified source to a string of delimiter delimited values.

    Declaration
    public static string ToDelimitedString<TSource>(IEnumerable<TSource> source, string delimiter)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<TSource> source

    A sequence of elements to be converted.

    System.String delimiter

    The delimiter specification.

    Returns
    Type Description
    System.String

    A System.String of delimited values from the by parameter specified delimiter.

    Type Parameters
    Name Description
    TSource

    The type of the elements of the sequence to convert.

    | Improve this Doc

    ToDelimitedString<TSource>(IEnumerable<TSource>, String, Func<TSource, String>)

    Converts the specified source to a string of delimiter delimited values.

    Declaration
    public static string ToDelimitedString<TSource>(IEnumerable<TSource> source, string delimiter, Func<TSource, string> converter)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<TSource> source

    A sequence of elements to be converted.

    System.String delimiter

    The delimiter specification.

    System.Func<TSource, System.String> converter

    The function delegate that converts TSource to a string representation once per iteration.

    Returns
    Type Description
    System.String

    A System.String of delimited values from the by parameter specified delimiter.

    Type Parameters
    Name Description
    TSource

    The type of the elements of the sequence to convert.

    | Improve this Doc

    ToDelimitedString<TSource>(IEnumerable<TSource>, String, String)

    Converts the specified source to a string of delimiter delimited values.

    Declaration
    public static string ToDelimitedString<TSource>(IEnumerable<TSource> source, string delimiter, string format)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<TSource> source

    A sequence of elements to be converted.

    System.String delimiter

    The delimiter specification.

    System.String format

    The desired format of the converted values.

    Returns
    Type Description
    System.String

    A System.String of delimited values from the by parameter specified delimiter.

    Type Parameters
    Name Description
    TSource

    The type of the elements of the sequence to convert.

    | Improve this Doc

    ToDelimitedString<TSource>(IEnumerable<TSource>, String, String, Func<TSource, String>)

    Converts the specified source to a string of delimiter delimited values.

    Declaration
    public static string ToDelimitedString<TSource>(IEnumerable<TSource> source, string delimiter, string format, Func<TSource, string> converter)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<TSource> source

    A sequence of elements to be converted.

    System.String delimiter

    The delimiter specification.

    System.String format

    The desired format of the converted values.

    System.Func<TSource, System.String> converter

    The function delegate that converts TSource to a string representation once per iteration.

    Returns
    Type Description
    System.String

    A System.String of delimited values from the by parameter specified delimiter.

    Type Parameters
    Name Description
    TSource

    The type of the elements of the sequence to convert.

    | Improve this Doc

    ToDelimitedString<TSource, T>(IEnumerable<TSource>, String, Func<TSource, T, String>, T)

    Converts the specified source to a string of delimiter delimited values.

    Declaration
    public static string ToDelimitedString<TSource, T>(IEnumerable<TSource> source, string delimiter, Func<TSource, T, string> converter, T arg)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<TSource> source

    A collection of values to be converted.

    System.String delimiter

    The delimiter specification.

    System.Func<TSource, T, System.String> converter

    The function delegate that converts TSource to a string representation once per iteration.

    T arg

    The parameter of the function delegate converter.

    Returns
    Type Description
    System.String

    A System.String of delimited values from the by parameter specified delimiter.

    Type Parameters
    Name Description
    TSource

    The type of the elements of the sequence to convert.

    T

    The type of the parameter of the function delegate converter.

    | Improve this Doc

    ToDelimitedString<TSource, T>(IEnumerable<TSource>, String, String, Func<TSource, T, String>, T)

    Converts the specified source to a string of delimiter delimited values.

    Declaration
    public static string ToDelimitedString<TSource, T>(IEnumerable<TSource> source, string delimiter, string format, Func<TSource, T, string> converter, T arg)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<TSource> source

    A collection of values to be converted.

    System.String delimiter

    The delimiter specification.

    System.String format

    The desired format of the converted values.

    System.Func<TSource, T, System.String> converter

    The function delegate that converts TSource to a string representation once per iteration.

    T arg

    The parameter of the function delegate converter.

    Returns
    Type Description
    System.String

    A System.String of delimited values from the by parameter specified delimiter.

    Type Parameters
    Name Description
    TSource

    The type of the elements of the sequence to convert.

    T

    The type of the parameter of the function delegate converter.

    | Improve this Doc

    ToDelimitedString<TSource, T1, T2>(IEnumerable<TSource>, String, Func<TSource, T1, T2, String>, T1, T2)

    Converts the specified source to a string of delimiter delimited values.

    Declaration
    public static string ToDelimitedString<TSource, T1, T2>(IEnumerable<TSource> source, string delimiter, Func<TSource, T1, T2, string> converter, T1 arg1, T2 arg2)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<TSource> source

    A collection of values to be converted.

    System.String delimiter

    The delimiter specification.

    System.Func<TSource, T1, T2, System.String> converter

    The function delegate that converts TSource to a string representation once per iteration.

    T1 arg1

    The first parameter of the function delegate converter.

    T2 arg2

    The second parameter of the function delegate converter.

    Returns
    Type Description
    System.String

    A System.String of delimited values from the by parameter specified delimiter.

    Type Parameters
    Name Description
    TSource

    The type of the elements of the sequence to convert.

    T1

    The type of the first parameter of the function delegate converter.

    T2

    The type of the second parameter of the function delegate converter.

    | Improve this Doc

    ToDelimitedString<TSource, T1, T2>(IEnumerable<TSource>, String, String, Func<TSource, T1, T2, String>, T1, T2)

    Converts the specified source to a string of delimiter delimited values.

    Declaration
    public static string ToDelimitedString<TSource, T1, T2>(IEnumerable<TSource> source, string delimiter, string format, Func<TSource, T1, T2, string> converter, T1 arg1, T2 arg2)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<TSource> source

    A collection of values to be converted.

    System.String delimiter

    The delimiter specification.

    System.String format

    The desired format of the converted values.

    System.Func<TSource, T1, T2, System.String> converter

    The function delegate that converts TSource to a string representation once per iteration.

    T1 arg1

    The first parameter of the function delegate converter.

    T2 arg2

    The second parameter of the function delegate converter.

    Returns
    Type Description
    System.String

    A System.String of delimited values from the by parameter specified delimiter.

    Type Parameters
    Name Description
    TSource

    The type of the elements of the sequence to convert.

    T1

    The type of the first parameter of the function delegate converter.

    T2

    The type of the second parameter of the function delegate converter.

    | Improve this Doc

    ToDelimitedString<TSource, T1, T2, T3>(IEnumerable<TSource>, String, Func<TSource, T1, T2, T3, String>, T1, T2, T3)

    Converts the specified source to a string of delimiter delimited values.

    Declaration
    public static string ToDelimitedString<TSource, T1, T2, T3>(IEnumerable<TSource> source, string delimiter, Func<TSource, T1, T2, T3, string> converter, T1 arg1, T2 arg2, T3 arg3)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<TSource> source

    A collection of values to be converted.

    System.String delimiter

    The delimiter specification.

    System.Func<TSource, T1, T2, T3, System.String> converter

    The function delegate that converts TSource to a string representation once per iteration.

    T1 arg1

    The first parameter of the function delegate converter.

    T2 arg2

    The second parameter of the function delegate converter.

    T3 arg3

    The third parameter of the function delegate converter.

    Returns
    Type Description
    System.String

    A System.String of delimited values from the by parameter specified delimiter.

    Type Parameters
    Name Description
    TSource

    The type of the elements of the sequence to convert.

    T1

    The type of the first parameter of the function delegate converter.

    T2

    The type of the second parameter of the function delegate converter.

    T3

    The type of the third parameter of the function delegate converter.

    | Improve this Doc

    ToDelimitedString<TSource, T1, T2, T3>(IEnumerable<TSource>, String, String, Func<TSource, T1, T2, T3, String>, T1, T2, T3)

    Converts the specified source to a string of delimiter delimited values.

    Declaration
    public static string ToDelimitedString<TSource, T1, T2, T3>(IEnumerable<TSource> source, string delimiter, string format, Func<TSource, T1, T2, T3, string> converter, T1 arg1, T2 arg2, T3 arg3)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<TSource> source

    A collection of values to be converted.

    System.String delimiter

    The delimiter specification.

    System.String format

    The desired format of the converted values.

    System.Func<TSource, T1, T2, T3, System.String> converter

    The function delegate that converts TSource to a string representation once per iteration.

    T1 arg1

    The first parameter of the function delegate converter.

    T2 arg2

    The second parameter of the function delegate converter.

    T3 arg3

    The third parameter of the function delegate converter.

    Returns
    Type Description
    System.String

    A System.String of delimited values from the by parameter specified delimiter.

    Type Parameters
    Name Description
    TSource

    The type of the elements of the sequence to convert.

    T1

    The type of the first parameter of the function delegate converter.

    T2

    The type of the second parameter of the function delegate converter.

    T3

    The type of the third parameter of the function delegate converter.

    | Improve this Doc

    ToDelimitedString<TSource, T1, T2, T3, T4>(IEnumerable<TSource>, String, Func<TSource, T1, T2, T3, T4, String>, T1, T2, T3, T4)

    Converts the specified source to a string of delimiter delimited values.

    Declaration
    public static string ToDelimitedString<TSource, T1, T2, T3, T4>(IEnumerable<TSource> source, string delimiter, Func<TSource, T1, T2, T3, T4, string> converter, T1 arg1, T2 arg2, T3 arg3, T4 arg4)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<TSource> source

    A collection of values to be converted.

    System.String delimiter

    The delimiter specification.

    System.Func<TSource, T1, T2, T3, T4, System.String> converter

    The function delegate that converts TSource to a string representation once per iteration.

    T1 arg1

    The first parameter of the function delegate converter.

    T2 arg2

    The second parameter of the function delegate converter.

    T3 arg3

    The third parameter of the function delegate converter.

    T4 arg4

    The fourth parameter of the function delegate converter.

    Returns
    Type Description
    System.String

    A System.String of delimited values from the by parameter specified delimiter.

    Type Parameters
    Name Description
    TSource

    The type of the elements of the sequence to convert.

    T1

    The type of the first parameter of the function delegate converter.

    T2

    The type of the second parameter of the function delegate converter.

    T3

    The type of the third parameter of the function delegate converter.

    T4

    The type of the fourth parameter of the function delegate converter.

    | Improve this Doc

    ToDelimitedString<TSource, T1, T2, T3, T4>(IEnumerable<TSource>, String, String, Func<TSource, T1, T2, T3, T4, String>, T1, T2, T3, T4)

    Converts the specified source to a string of delimiter delimited values.

    Declaration
    public static string ToDelimitedString<TSource, T1, T2, T3, T4>(IEnumerable<TSource> source, string delimiter, string format, Func<TSource, T1, T2, T3, T4, string> converter, T1 arg1, T2 arg2, T3 arg3, T4 arg4)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<TSource> source

    A collection of values to be converted.

    System.String delimiter

    The delimiter specification.

    System.String format

    The desired format of the converted values.

    System.Func<TSource, T1, T2, T3, T4, System.String> converter

    The function delegate that converts TSource to a string representation once per iteration.

    T1 arg1

    The first parameter of the function delegate converter.

    T2 arg2

    The second parameter of the function delegate converter.

    T3 arg3

    The third parameter of the function delegate converter.

    T4 arg4

    The fourth parameter of the function delegate converter.

    Returns
    Type Description
    System.String

    A System.String of delimited values from the by parameter specified delimiter.

    Type Parameters
    Name Description
    TSource

    The type of the elements of the sequence to convert.

    T1

    The type of the first parameter of the function delegate converter.

    T2

    The type of the second parameter of the function delegate converter.

    T3

    The type of the third parameter of the function delegate converter.

    T4

    The type of the fourth parameter of the function delegate converter.

    | Improve this Doc

    ToDelimitedString<TSource, T1, T2, T3, T4, T5>(IEnumerable<TSource>, String, Func<TSource, T1, T2, T3, T4, T5, String>, T1, T2, T3, T4, T5)

    Converts the specified source to a string of delimiter delimited values.

    Declaration
    public static string ToDelimitedString<TSource, T1, T2, T3, T4, T5>(IEnumerable<TSource> source, string delimiter, Func<TSource, T1, T2, T3, T4, T5, string> converter, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<TSource> source

    A collection of values to be converted.

    System.String delimiter

    The delimiter specification.

    System.Func<TSource, T1, T2, T3, T4, T5, System.String> converter

    The function delegate that converts TSource to a string representation once per iteration.

    T1 arg1

    The first parameter of the function delegate converter.

    T2 arg2

    The second parameter of the function delegate converter.

    T3 arg3

    The third parameter of the function delegate converter.

    T4 arg4

    The fourth parameter of the function delegate converter.

    T5 arg5

    The fifth parameter of the function delegate converter.

    Returns
    Type Description
    System.String

    A System.String of delimited values from the by parameter specified delimiter.

    Type Parameters
    Name Description
    TSource

    The type of the elements of the sequence to convert.

    T1

    The type of the first parameter of the function delegate converter.

    T2

    The type of the second parameter of the function delegate converter.

    T3

    The type of the third parameter of the function delegate converter.

    T4

    The type of the fourth parameter of the function delegate converter.

    T5

    The type of the fifth parameter of the function delegate converter.

    | Improve this Doc

    ToDelimitedString<TSource, T1, T2, T3, T4, T5>(IEnumerable<TSource>, String, String, Func<TSource, T1, T2, T3, T4, T5, String>, T1, T2, T3, T4, T5)

    Converts the specified source to a string of delimiter delimited values.

    Declaration
    public static string ToDelimitedString<TSource, T1, T2, T3, T4, T5>(IEnumerable<TSource> source, string delimiter, string format, Func<TSource, T1, T2, T3, T4, T5, string> converter, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<TSource> source

    A collection of values to be converted.

    System.String delimiter

    The delimiter specification.

    System.String format

    The desired format of the converted values.

    System.Func<TSource, T1, T2, T3, T4, T5, System.String> converter

    The function delegate that converts TSource to a string representation once per iteration.

    T1 arg1

    The first parameter of the function delegate converter.

    T2 arg2

    The second parameter of the function delegate converter.

    T3 arg3

    The third parameter of the function delegate converter.

    T4 arg4

    The fourth parameter of the function delegate converter.

    T5 arg5

    The fifth parameter of the function delegate converter.

    Returns
    Type Description
    System.String

    A System.String of delimited values from the by parameter specified delimiter.

    Type Parameters
    Name Description
    TSource

    The type of the elements of the sequence to convert.

    T1

    The type of the first parameter of the function delegate converter.

    T2

    The type of the second parameter of the function delegate converter.

    T3

    The type of the third parameter of the function delegate converter.

    T4

    The type of the fourth parameter of the function delegate converter.

    T5

    The type of the fifth parameter of the function delegate converter.

    | Improve this Doc

    ToEnumerable(IEnumerable<Char>)

    Converts the specified value to its equivalent System.String sequence.

    Declaration
    public static IEnumerable<string> ToEnumerable(IEnumerable<char> value)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<System.Char> value

    The value to convert into a sequence.

    Returns
    Type Description
    System.Collections.Generic.IEnumerable<System.String>

    A System.String sequence equivalent to the specified value.

    | Improve this Doc

    ToHexadecimal(Byte[])

    Converts the specified value to its equivalent hexadecimal representation.

    Declaration
    public static string ToHexadecimal(byte[] value)
    Parameters
    Type Name Description
    System.Byte[] value

    The byte array to be converted.

    Returns
    Type Description
    System.String

    A hexadecimal System.String representation of the elements in value.

    Exceptions
    Type Condition
    System.ArgumentNullException

    value is null.

    | Improve this Doc

    ToHexadecimal(String, Action<EncodingOptions>)

    Converts the specified value to its equivalent hexadecimal representation.

    Declaration
    public static string ToHexadecimal(string value, Action<EncodingOptions> setup = null)
    Parameters
    Type Name Description
    System.String value

    The string to be converted.

    System.Action<EncodingOptions> setup

    The EncodingOptions which need to be configured.

    Returns
    Type Description
    System.String

    A hexadecimal System.String representation of the characters in value.

    Remarks

    EncodingOptions will be initialized with DefaultPreambleSequence and DefaultEncoding.

    Exceptions
    Type Condition
    System.ArgumentNullException

    value is null.

    | Improve this Doc

    ToMorseCode(String)

    Converts the specified value to an international Morse code representation.

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

    The System.String value to convert.

    Returns
    Type Description
    System.String

    An international Morse code representation of the specified System.String value.

    Remarks

    Any characters not supported by the international Morse code specifications is excluded from the result.

    | Improve this Doc

    ToMorseCode(String, Boolean)

    Converts the specified value to an international Morse code representation.

    Declaration
    public static string ToMorseCode(string value, bool includeUnsupportedCharacters)
    Parameters
    Type Name Description
    System.String value

    The System.String value to convert.

    System.Boolean includeUnsupportedCharacters

    if set to true characters not supported by the internal Morse code is left intact in the result for a general impression.

    Returns
    Type Description
    System.String

    An international Morse code representation of the specified value parameter.

    | Improve this Doc

    ToPascalCasing(String)

    Converts the specified value to a pascal-case representation, using culture-independent casing rules.

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

    The System.String value to convert.

    Returns
    Type Description
    System.String

    A pascal-case representation of the specified System.String value.

    | Improve this Doc

    ToProtocolRelativeUri(Uri)

    Converts the specified value of an System.Uri to its equivalent protocol-relative System.String.

    Declaration
    public static string ToProtocolRelativeUri(Uri value)
    Parameters
    Type Name Description
    System.Uri value

    The System.Uri to be converted.

    Returns
    Type Description
    System.String

    A System.String that is a protocol-relative equivalent to value.

    | Improve this Doc

    ToProtocolRelativeUri(Uri, String)

    Converts the specified value of an System.Uri to its equivalent protocol-relative System.String.

    Declaration
    public static string ToProtocolRelativeUri(Uri value, string relativeReference)
    Parameters
    Type Name Description
    System.Uri value

    The System.Uri to be converted.

    System.String relativeReference

    The relative reference to prefix the result with. Default is NetworkPathReference.

    Returns
    Type Description
    System.String

    A System.String that is a protocol-relative equivalent to value.

    | Improve this Doc

    ToUrlEncodedBase64(Byte[])

    Encodes a byte array into its equivalent string representation using base 64 digits, which is usable for transmission on the URL.

    Declaration
    public static string ToUrlEncodedBase64(byte[] value)
    Parameters
    Type Name Description
    System.Byte[] value

    The byte array to encode.

    Returns
    Type Description
    System.String

    The string containing the encoded token if the byte array length is greater than one; otherwise, an empty string ("").

    Remarks

    Source: http://tools.ietf.org/html/draft-ietf-jose-json-web-signature-08#appendix-C

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