I have a HTML page in my .Net project in that I have one script section
<script language="javascript" type="text/javascript">
s.property1="|*|property1|*|"
s.property2="|*|property2|*|"
<script>
In the c# code I'm reading the html file and replacing the "| * |property1| *|" values like below
StringBuilder siteCode = new StringBuilder();
//code to append html file to StringBuilder(siteCode)
if(xyz!=null)
{
siteCode.Replace("|*|property1|*|", xyz);
}
else
{
//remove s.property1="|*|property1|*|"
}
How can I remove s.property1="||property1||" from StringBuilder(siteCode)
?
Just use the StringBuilder Replace method?
siteCode.Replace("s.property1=\"||property1||\"", "");