Class Replacer
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
Remove(string)
Remove an entry from the map.
public void Remove(string src)
Parameters
src
stringThe original field from the entry.
TransformBackward(string)
Transform a text with replacing chars from destination to source.
public string TransformBackward(string text)
Parameters
text
stringThe 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
stringThe 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.