Table of Contents

Class StringExtensions

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

Extension methods for the System.String class.

public static class StringExtensions
Inheritance
Object
StringExtensions

Methods

ToStream(String, Action<EncodingOptions>)

Converts the specified value to a System.IO.Stream.

public static Stream ToStream(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

Stream

A System.IO.Stream containing the result of the specified value.

Remarks

Exceptions

System.ArgumentNullException

value cannot be null.

System.ComponentModel.InvalidEnumArgumentException

setup was initialized with an invalid Preamble.

ToStreamAsync(String, Action<AsyncEncodingOptions>)

Converts the specified value to a System.IO.Stream.

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

Parameters

value String

The System.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 System.IO.Stream containing the result of the specified value.

Remarks

Exceptions

System.ArgumentNullException

value cannot be null.

System.ComponentModel.InvalidEnumArgumentException

setup was initialized with an invalid Preamble.

ToTextReader(String)

Converts the specified value to a System.IO.TextReader object.

public static TextReader ToTextReader(this string value)

Parameters

value String

The System.String to extend.

Returns

TextReader

A System.IO.TextReader initialized with value.