fork(1) download
  1. using System;
  2. using System.Text.RegularExpressions;
  3.  
  4. public class Test
  5. {
  6. public static void Main()
  7. {
  8. string str = @"<h1>My Html</h1>
  9. <div>
  10. <p>bla bla bla</p>
  11. <table>
  12. <!-- table content -->
  13. </table>
  14. </div>";
  15. string result = Regex.Replace(str, @"(?m)\n\s*(?=<)", "");
  16. Console.WriteLine(result);
  17. Console.ReadLine();
  18. }
  19. }
Success #stdin #stdout 0.08s 34080KB
stdin
Standard input is empty
stdout
<h1>My Html</h1><div><p>bla bla bla</p><table><!-- table content --></table></div>