Table of Contents

ToByteArray Method

Definition

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

ToByteArray(string, Action<EncodingOptions>)

Converts the specified input to its equivalent byte array representation.

public static byte[] ToByteArray(this string input, Action<EncodingOptions> setup = null)

Parameters

input string

The string to be converted into a byte array.

setup Action<EncodingOptions>

The EncodingOptions which may be configured.

Returns

byte[]

A byte array that is equivalent to input.

Exceptions

ArgumentNullException

input cannot be null.

InvalidEnumArgumentException

setup was initialized with an invalid Preamble.

See Also