public static string FormatWithSearchTerm(string searchTerm, string text, params object[] args)
{
if (String.IsNullOrWhiteSpace(text) || String.IsNullOrWhiteSpace(searchTerm))
{
return text;
}
if (args != null && args.Length > 0)
{
text = String.Format(text, args);
}
return Regex.Replace(text, searchTerm, @"<em class='keyword'>$&</em>", RegexOptions.IgnoreCase);
}