Table of Contents

Class StringExtensions

Namespace
Cuemon.Extensions.Text
Assembly
Cuemon.Extensions.Text.dll

Extension methods for the System.String class.

public static class StringExtensions
Inheritance
Object
StringExtensions

Methods

ToAsciiEncodedString(String, Action<EncodingOptions>)

Encodes all the characters in the specified value to its ASCII encoded variant.

public static string ToAsciiEncodedString(this string value, Action<EncodingOptions> setup = null)

Parameters

value String

The System.String to extend.

setup Action<EncodingOptions>

The EncodingOptions which may be configured.

Returns

String

A System.String variant of value that is ASCII encoded.

Exceptions

System.ArgumentNullException

value cannot be null.

ToEncodedString(String, Action<FallbackEncodingOptions>)

Encodes all the characters in the specified value to its encoded System.String variant.

public static string ToEncodedString(this string value, Action<FallbackEncodingOptions> setup = null)

Parameters

value String

The System.String to extend.

setup Action<FallbackEncodingOptions>

The FallbackEncodingOptions which may be configured.

Returns

String

A System.String variant of value that is encoded with TargetEncoding.

Remarks

The inspiration for this method was retrieved @ SO: https://stackoverflow.com/a/135473/175073.

Exceptions

System.ArgumentNullException

value cannot be null.