internal static string ToStrippedHtmlText(object input)
{
string retVal = string.Empty;
if (input != null)
{
// Replace HTML line break tags with $LINEBREAK$:
retVal = Regex.Replace(input as string, htmlLineBreakRegex, "$LINEBREAK$", RegexOptions.IgnoreCase);
// Remove the rest of HTML tags:
retVal = Regex.Replace(retVal, htmlStripperRegex, string.Empty);
#if !SILVERLIGHT
// In WPF all { characters must appear after a \ in XAML:
retVal = retVal.Replace("{", "\\{");
#endif
}
return retVal;
}