modify your c# code with this
here html
<div id="node5" runat="server">
address
424 G UT <br>
</div>
<div>
<asp:Button ID="btmGetDivdetails" runat="server" Text="getDivdetails"
onclick="btmGetDivdetails_Click" />
</div>
here c# code on the button click
protected void btmGetDivdetails_Click(object sender, EventArgs e)
{
string trimstr = node5.InnerHtml;
trimstr = trimstr.Replace("\r\n<br>", "").Replace("\r", "").Replace("\n", "").Trim();
if (trimstr.Contains("<br>"))
{
trimstr = trimstr.Replace("<br>", "");
}
List<char> result = trimstr.ToList();
result.RemoveAll(c => c == ' ');
string finalresult = new string(result.ToArray());
}
now the finalresult is "address424GUT"