<pre>
<p>The accounting equation asset = capital + liabilities, which of the following is true. Ram has started business with 5,50,000 and has purchased goods worth 1,50,000 on credit</p><p>
<input type='radio' id='op1' name='q2option' value='1' /> a) 7,00,000 = 5,50,000 + 1,50,000
<input type='radio' id='op2' name='q2option' value='2' />b)7,00,000 = 6,50,000 + 50,000</p>
<p>
<input type='radio' id='op3' name='q2option' value='3' /> c) 5,50,000 = 7,00,000 - 1,50,000
<input type='radio' id='op3' name='q2option' value='4' > d)5,50,000 = 5,00,000 + 50,000</p>
</pre>
我想在C#.Net for windows应用程序中删除输入标记 我更改了输入标记结构以显示代码
答案 0 :(得分:1)
您可以使用正则表达式从字符串中删除输入标记:
var temp = "The accounting equation asset = capital + liabilities, which of the following is true. Ram has started business with 5,50,000 and has purchased goods worth 1,50,000 on credit <input type='radio' id='op1' name='q2option' value='1' /> a) 7,00,000 = 5,50,000 + 1,50,000 <input type='radio' id='op2' name='q2option' value='2' />b)7,00,000 = 6,50,000 + 50,000 <input type='radio' id='op3' name='q2option' value='3' /> c) 5,50,000 = 7,00,000 - 1,50,000 <input type='radio' id='op3' name='q2option' value='4' /> d)5,50,000 = 5,00,000 + 50,000";
var regInput = new Regex("(.*?)(\\<input[^\\>]*\\>)(.*?)");
var result =regInput.Replace(temp,"$1$3");