Table of Contents

ToEncodedString Method

Definition

Namespace
Cuemon
Assemblies
Cuemon.Core.dll
Source
src/Cuemon.Core/Extensions/StringDecoratorExtensions.cs

ToEncodedString(IDecorator<string>, Action<FallbackEncodingOptions>)

Encodes all the characters in the enclosed string of the specified decorator to its encoded string variant.

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

Parameters

decorator IDecorator<string>

The IDecorator<T> to extend.

setup Action<FallbackEncodingOptions>

The FallbackEncodingOptions which may be configured.

Returns

string

A string variant of the enclosed string of the specified decorator that is encoded with TargetEncoding.

Remarks

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

Exceptions

ArgumentNullException

decorator cannot be null.