Say I have the following HTML string
<head>
</head>
<body>
<img src="stickman.gif" width="24" height="39" alt="Stickman">
<a href="http://www.w3schools.com">W3Schools</a>
</body>
I want to add a string in between the <head>
tags. So the final HTML string become
<head>
<base href="http://www.w3schools.com/images/">
</head>
<body>
<img src="stickman.gif" width="24" height="39" alt="Stickman">
<a href="http://www.w3schools.com">W3Schools</a>
</body>
So I have to search for the first occurrence of the <head>
string then insert <base href="http://www.w3schools.com/images/">
right after.
How do I do this in C#.
`?
– Jodrell May 13 '13 at 09:23