StringManipulation.TranslateChars Method
- Namespace
- Kampute.DocToolkit.Support
- Assembly
- Kampute.DocToolkit.dll
Definition
Translates multiple characters in the given string to corresponding characters.
public static string TranslateChars(this string text, ReadOnlySpan<char> fromChars, ReadOnlySpan<char> toChars)Parameters
textstring- The string to process.
fromCharsReadOnlySpan<char>- The characters to translate from.
toCharsReadOnlySpan<char>- The characters to translate to.
Returns
- string
- A new string with the specified characters translated.
Exceptions
- ArgumentNullException
- Thrown when
textisnull. - ArgumentException
- Thrown when the lengths of
fromCharsandtoCharsare not the same.
