C# 中文简繁转换
作者:互联网
1.简繁转换引用的是Microsoft.VisualBasic程序集;
2.代码如下:
/// <summary> /// 中文简繁转换 /// </summary> /// <param name="x">中文</param> /// <param name="type">0.转繁体 1.转简体</param> /// <returns></returns> public static string StringConvert(string x, int type) { var value = string.Empty; switch (type) { case 0://转繁体 value = Microsoft.VisualBasic.Strings.StrConv(x, Microsoft.VisualBasic.VbStrConv.TraditionalChinese, 0); break; case 1://转简体 value = Microsoft.VisualBasic.Strings.StrConv(x, Microsoft.VisualBasic.VbStrConv.SimplifiedChinese, 0); break; } return value; }
标签:中文,VisualBasic,C#,简繁转换,value,Microsoft,string 来源: https://www.cnblogs.com/yellow3gold/p/15900162.html