How to remove special character from Unicode string

Here is the sample code to remove special character from Unicode string.
Sample Input: SG@%@sgs th? g#%@^@#$ chào^#^$#!abc35| _ sgs _35 hello world không gsg
Sample Output: SG%sgs th? g#%^#$ chào^#^$#!abc35 sgs 35 hello world không gsg

    class Program
    {
        static void Main(string[] args)
        {
            string inputString = "SG@%@sgs thể g#%@^@#$ chào^#^$#!abc35| _ sgs _35 hello world không gsg";

            string outputString = inputString.Replace("@", "").Replace("|", "").Replace("_", "");

            Console.WriteLine(inputString);
            Console.WriteLine(outputString);
            Console.ReadKey();
        }
    }
Please share, if it is helpfulShare on FacebookShare on LinkedInTweet about this on TwitterShare on Google+Email this to someonePrint this page

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>