Table of Contents

Class Replacer

Namespace
Yarhl.Media.Text
Assembly
Yarhl.Media.Text.dll

Replaces substrings in a text from a map.

public class Replacer
Inheritance
Replacer
Inherited Members

Constructors

Replacer()

Initializes a new instance of the Replacer class.

public Replacer()

Properties

Map

Gets the map for the replacements.

public ReadOnlyCollection<ReplacerEntry> Map { get; }

Property Value

ReadOnlyCollection<ReplacerEntry>

The map for the replacements.

Methods

Add(string, string)

Add or replace an entry in the map.

public void Add(string src, string dst)

Parameters

src string

The source field for the entry.

dst string

The destination field for the entry.

Remove(string)

Remove an entry from the map.

public void Remove(string src)

Parameters

src string

The original field from the entry.

TransformBackward(string)

Transform a text with replacing chars from destination to source.

public string TransformBackward(string text)

Parameters

text string

The text to transform.

Returns

string

The transformed text.

Remarks

When multiple original fields in the map have same start, the later map entry will have preference.

TransformForward(string)

Transform a text replacing the chars from source to destination.

public string TransformForward(string text)

Parameters

text string

The text to transform.

Returns

string

The transformed text.

Remarks

When multiple original fields in the map have same start, the later map entry will have preference.