Public string TranToTrade (string text) // convert to traditional
{
If (text. ToString (). Length> 0)
{
String Sstr = Conversions. ToString (this. getSimple ());
String Tstr = Conversions. ToString (this. getTrade ());
Char [] TradeArr = Tstr. ToCharArray (0, Tstr. Length-1 );
Int VB $ t_i4 $ L0 = text. Length-1;
For (int I = 0; I <= VB $ t_i4 $ L0; I ++)
{
Char oldstr = Conversions. ToChar (text. Substring (I, 1 ));
If (Sstr. Contains (Conversions. ToString (oldstr )))
{
Char newstr = TradeArr [Sstr. IndexOf (oldstr)];
Text = text. Replace (oldstr, newstr );
}
}
Return text;
}
// Interaction. MsgBox ("no Chinese characters entered", MsgBoxStyle. OkOnly, null );
Return text;
}
Public string TranToSimple (string text) // convert to simplified.
{
If (text. ToString (). Length> 0)
{
String Sstr = Conversions. ToString (this. getSimple ());
String Tstr = Conversions. ToString (this. getTrade ());
Char [] simpleArr = Sstr. ToCharArray (0, Sstr. Length-1 );
Int VB $ t_i4 $ L0 = text. Length-1;
For (int I = 0; I <= VB $ t_i4 $ L0; I ++)