richTextBox1是輸入文本框,richTextBox2是結果文本框
private void button1_Click(object sender, System.EventArgs e)
...{
this.richTextBox2.Text="";
String MyString = this.richTextBox1.Text;
// MyString = MyString.ToLower();
MyString = MyString.Replace("\u","\");
MyString = MyString.Replace("\U","\");
string[] value1 = MyString.Split(''\'');
string tempValue1 = "";
string tempValue2 = ""; 
string strOut = "";
foreach (string temp in value1)...{
if(temp.Length==0)...{
continue;
}
try...{
tempValue1 =temp;
tempValue2 = "";
if(tempValue1.Length>4)
...{
tempValue1 = temp.Substring(0,4);
tempValue2 = temp.Substring(4,temp.Length-4);
}
int intASCII = Convert.ToInt32(tempValue1, 16);
strOut += ((char)intASCII).ToString() + tempValue2; 

}catch...{
strOut += temp;
}
;
}
// string dd = BB.ToString("X2");
//ok end

this.richTextBox2.Text = strOut;
}