Table of Contents

PreambleSequence Enum

Definition

Namespace
Cuemon.Text
Assemblies
Cuemon.Kernel.dll
Source
src/Cuemon.Kernel/Text/PreambleSequence.cs

Specifies what action to take in regards to encoding preamble sequences.

public enum PreambleSequence

Fields

Keep = 0

Any encoding preamble sequences will be preserved.

Remove = 1

Any encoding preamble sequences will be removed.

Examples

The following example demonstrates how to use PreambleSequence with EncodingOptions to control whether byte order marks (BOM) are preserved or removed.

using System;
using System.Text;
using Cuemon.Text;

namespace MyApp.Examples;

public class PreambleSequenceExample
{
    public void Demonstrate()
    {
        var options = new EncodingOptions
        {
            Encoding = Encoding.UTF8,
            Preamble = PreambleSequence.Keep
        };

        var preambleAction = options.Preamble;
        var encoding = options.Encoding;

        Console.WriteLine(preambleAction); // outputs: Keep

}
}