/// <summary> /// Expands selected Latin glyphs /// into their decimal entity equivalent. /// </summary> /// <param name="glyphText"> /// The <see cref="System.String"/> /// containing the glyphs. /// </param> /// <returns> /// Returns a <see cref="System.String"/> /// with decimal entities. /// </returns> public static string Expand(string glyphText) { if (_glyphs.Count == 0) { LatinGlyphs.AddGlyphs(); } foreach (string s in _glyphs.Keys) { glyphText = glyphText.Replace(s, _glyphs[s]); } return(glyphText); }
/// <summary> /// Condenses selected decimal entities /// into their Latin glyph equivalent. /// </summary> /// <param name="entityText"> /// The <see cref="System.String"/> /// containing the decimal entities. /// </param> /// <returns> /// Returns a <see cref="System.String"/> /// with Latin glyphs. /// </returns> public static string Condense(string entityText) { if (_glyphs.Count == 0) { LatinGlyphs.AddGlyphs(); } foreach (string s in _glyphs.Keys) { entityText = entityText.Replace(_glyphs[s], s); } //Search for selected named entities: entityText = entityText.Replace("©", "©"); entityText = entityText.Replace("é", "é"); entityText = entityText.Replace(" ", " "); entityText = entityText.Replace("®", "®"); entityText = entityText.Replace("™", "™"); return(entityText); }