[Solved] remove html input tag from string using C#


You could remove input tags from the string with a regular expression:

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");

1

solved remove html input tag from string using C#