How to replace script html content in StringBuilder
I have an HTML page in my .Net project as I have one script section
<script language="javascript" type="text/javascript">
s.property1="|*|property1|*|"
s.property2="|*|property2|*|"
<script>
In C # code, I read html file and replace "| * | property1 | * |" values ββgiven 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 to remove s.property1 = "|| property1 ||" from StringBuilder(siteCode)
?
+3
source to share