Thursday, 12 September 2013

Replace in Html file

Replace in Html file

I am using following code. It displays only HTML file in list box I want
to replace Figure 1, Figure 1.2, Figure 2, Figure 2.1 so on ....... with
Figure 1 ........... in OutPut
please help me
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
FileInfo file = new FileInfo(textBox1.Text);
StreamReader stRead = file.OpenText();
while (!stRead.EndOfStream)
{
listBox1.Items.Add(stRead.ReadLine());
}
}
}
output
<html>
<head>
</head>
<body>
<div>
<p class="epigraph"> very Figure 1 But thanks to you, we won&#x0027;t do
it </p>
<p class="epigraph-right"> birthday Figure 1.1 Milton Friedman, November
8, 2002</p>
<p class="indent">Not Figure 2 able to take it any longer New York </p>
<p class="indent">Mr. Cutler Figure 2.1 of the parallel plunges</p>
</body>
</div>
</html>

No comments:

Post a Comment