using System;
using System.IO;
using System.Net.Mail;
using System.Collections.Generic;
using System.Security.Cryptography;
using System.Text;
using System.Text.RegularExpressions;
using System.Configuration;
using System.Globalization;
using System.Web;
using System.Web.Configuration;
using System.Threading;
using System.Reflection;
using System.Collections;
using System.Xml;
using System.Net;
using System.Web.Caching;
namespace BlogEngine.Core
{
///
/// Utilities for the entire solution to use.
///
public static class Utils
{
private static readonly Regex REGEX_BETWEEN_TAGS = new Regex(@">\s+", RegexOptions.Compiled);
private static readonly Regex REGEX_LINE_BREAKS = new Regex(@"\n\s+", RegexOptions.Compiled);
///
/// Removes the HTML whitespace.
///
/// The HTML.
public static string RemoveHtmlWhitespace(string html)
{
if (string.IsNullOrEmpty(html))
return string.Empty;
html = REGEX_BETWEEN_TAGS.Replace(html, "> ");
html = REGEX_LINE_BREAKS.Replace(html, string.Empty);
return html.Trim();
}
}
}