Table of Contents

Class StringExtensions

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

Extension methods for the string class.

public static class StringExtensions
Inheritance
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 string to extend.

setup Action<EncodingOptions>

The EncodingOptions which may be configured.

Returns

string

A string variant of value that is ASCII encoded.

Exceptions

ArgumentNullException

value cannot be null.

ToEncodedString(string, Action<FallbackEncodingOptions>)

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

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

Parameters

value string

The string to extend.

setup Action<FallbackEncodingOptions>

The FallbackEncodingOptions which may be configured.

Returns

string

A 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

ArgumentNullException

value cannot be null.