vijay mani

vijay mani

  • NA
  • 7
  • 3.7k

Html code readablity

Jan 24 2015 4:08 AM
How do I format the html source code (I have my html code in string format) for readability using C#?
I have to give alignment and spacing using code (indent for all child html elements) as similar to Visual studio.
My input:"<html><head></head><body><div><div>sample</div></div></body></html>"
Output should be:"
<html>
<head></head>
<body>
        <div>
             <div>
                    sample
             </div>
      </div>
</body>
</html>"

Answers (2)