Table of Contents

Class StringExtensions

Namespace
Cuemon.Extensions.IO
Assembly
Cuemon.Extensions.IO.dll

Extension methods for the string class.

public static class StringExtensions
Inheritance
StringExtensions

Methods

ToStream(string, Action<EncodingOptions>)

Converts the specified value to a Stream.

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

Parameters

value string

The string to extend.

setup Action<EncodingOptions>

The EncodingOptions which may be configured.

Returns

Stream

A Stream containing the result of the specified value.

Remarks

Exceptions

ArgumentNullException

value cannot be null.

InvalidEnumArgumentException

setup was initialized with an invalid Preamble.

ToStreamAsync(string, Action<AsyncEncodingOptions>)

Converts the specified value to a Stream.

public static Task<Stream> ToStreamAsync(this string value, Action<AsyncEncodingOptions> setup = null)

Parameters

value string

The string to extend.

setup Action<AsyncEncodingOptions>

The AsyncEncodingOptions which may be configured.

Returns

Task<Stream>

A task that represents the asynchronous operation. The task result contains a Stream containing the result of the specified value.

Remarks

Exceptions

ArgumentNullException

value cannot be null.

InvalidEnumArgumentException

setup was initialized with an invalid Preamble.

ToTextReader(string)

Converts the specified value to a TextReader object.

public static TextReader ToTextReader(this string value)

Parameters

value string

The string to extend.

Returns

TextReader

A TextReader initialized with value.