Skip to content

Latest commit

 

History

History
50 lines (34 loc) · 2.08 KB

File metadata and controls

50 lines (34 loc) · 2.08 KB

Replacing Symbols By Emoticons (ext. method)

This method provides an opportunity to replace symbols in latin text by corresponding Unicode Emoticons

emoticonsext

Method supports replacement of following combinations of symbols

  • :) or :-) to 😊
  • :( or :-( to ☹
  • -> or :--> to ☛
  • <- or :<-- to ☚
  • => or :==> to ➨
  • ...

How To Use

Just add This extension method to Your class or use it like class lybrary, and call method ReplaceEmoticons() in any string. If You are using method in console application You need to activate console unicode fonts, see how to do that here

The example of using this method in c# console application is

class Program
{
    static void Main(string[] args)
    {
        Console.WriteLine("Enter Your Text");
        string st = Console.ReadLine();
        Console.WriteLine(new string('-', 30));
        Console.OutputEncoding = System.Text.Encoding.UTF8;
        Console.WriteLine(st.ConvertEmoticons());
        Console.ReadKey();
    }
}

See Also

My another project for converting latin letters to armenian

Smart converter

lattoarmtrans

lattoarm

This project written on C# 6.0, .NET Framework 4.6 Visual Studio 2015 Comunity Edition