C# 繁体,简体互转

首先对Miscrosoft.VisualBasic类的引用.

using Microsoft.VisualBasic;

public static string Traditional2Simplified(string str)
        { //繁体转简体
            return (Microsoft.VisualBasic.Strings.StrConv(str, Microsoft.VisualBasic.VbStrConv.SimplifiedChinese, 0));

        }
        public static string Simplified2Traditional(string str)
        { //简体转繁体
            return (Microsoft.VisualBasic.Strings.StrConv(str as String, Microsoft.VisualBasic.VbStrConv.TraditionalChinese, 0));

        }

你可能感兴趣的:(C#)