首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

求帮忙~该怎么解决

2012-12-17 
求帮忙~!本帖最后由 lisiwen8 于 2012-11-26 15:43:08 编辑对XML文件的编辑 文本框输入?xml version1.0

求帮忙~!
本帖最后由 lisiwen8 于 2012-11-26 15:43:08 编辑 对XML文件的编辑 文本框输入
<?xml version="1.0" encoding="ISO-8859-1"?>
<1><to>George</to><2><from>John</from><heading>Reminder</heading></2><body>Don't forget the meeting!</body></1>

点击编辑后文本框显示:
<?xml version="1.0" encoding="ISO-8859-1"?>
  <1>
  <to>George</to>
  <2>
     <from>John</from>
     <heading>Reminder</heading>
  </2>
  <body>Don't forget the meeting!</body>
  </1>

<1><2>代表标签 
[最优解释]


private void button1_Click(object sender, EventArgs e)
        {
            textBox1.Text = Regex.Replace(textBox1.Text, @"\x20*(</?\d+>
[其他解释]
</[a-zA-Z]+>)", "$1\r\n");
        }


[其他解释]
引用:
C# code?



12345

private void button1_Click(object sender, EventArgs e)         {             textBox1.Text = Regex.Replace(textBox1.Text, @"\x20*(</?\d+>

热点排行