C# code
/// 轉全角的函數(SBC case) ///
///
任意字符串 /// 全角字符串 ///
///全角空格為
///其他字符半角(
public string ToSBC(string input)
{ //半角轉全角
char[] c=input
for (int i =
{
if (c[i]==
{
c[i]=(char)
}
if (c[i]<
}
return new string(c);
}
/// /// 轉半角的函數(DBC case) ///
///
任意字符串
/// 半角字符串 ///
///全角空格為
///其他字符半角(
public string ToDBC(string input)
{
char[] c=input
for (int i =
{
if (c[i]==
{
c[i]= (char)
}
if (c[i]>
c[i]=(char)(c[i]
}
return new string(c);
}
From:http://tw.wingwit.com/Article/program/net/201311/12161.html