2020-03-30 每日一例第21天
1.新建对话框,拖label/textbox控件;
2.后台代码;
public string GetABC(string str)
{
Regex reg = new Regex("^[\u4e00-\u9fa5]$");
byte[] arr = new byte[2];
string pystr = "";
Char[] mChar = str.ToCharArray();
return GetStr(mChar,pystr,reg,arr);
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
textBox2.Text = GetABC(textBox1.Text);
}