I'm using a Summernote jQuery plugin, I want to remove leading and trailing spaces and blank tags only containing   from the HTML output.I have tried string.Trim() function and its not working.
In the code, when I placed a debugger, I'm getting the following values from the multiline text box. Below code is just an example, I may also apply Bold, color, etc to my text, accordingly the HTML code may vary. Here is the Sample text
var str="<div>                      <br></div><div>                        <br></div><div>           Sample Text                  <br></div><div><br></div><div>                 <br></div><div>            <br></div>";
output="<div>Sample Text</div>"
Now how to remove the leading and trailing spaces from HTML ?
