string str = this.textBox1.Text; Regex regex = new Regex("0[xX][0-9a-fA-F]{2,5}"); MatchCollection mc = regex.Matches(str); foreach (Match m in mc) { str = str.Replace(m.Value, Convert.ToInt32(m.Value, 16) + ""); } this.textBox1.Text = str;
string str = this.textBox1.Text; Regex regex = new Regex("0[xX][0-9a-fA-F]{2,5}"); MatchCollection mc = regex.Matches(str); foreach (Match m in mc) { str = str.Replace(m.Value, Convert.ToInt32(m.Value, 16) + ""); } this.textBox1.Text = str;
转载于:https://www.cnblogs.com/ziranquliu/p/5630741.html