System.Text.RegularExpressions.MatchEvaluator
Sometimes, you need to highlight the search key words ( ex.google), there are loads of methods available out there for doing so , but very simple yet power code block i have just pasted below.
private string HighLight(string inputText, string searchKey)
{
if (searchKey.Length > 0)
{
// Setup the regular expression and add the Or operator.
Regex RegExp = new Regex(searchKey.Replace(" ", "|").Trim(), RegexOptions.IgnoreCase);
// Highlight keywords by calling the delegate each time a keyword is found.
return RegExp.Replace(inputText, new MatchEvaluator(ReplaceKeyWords));
}
return inputText;
}
public string ReplaceKeyWords(Match m)
{
return "" + m.Value + "";
}
/*CSS */
span.highlight
{
background-color : Yellow;
}
Use call this function with a search key and text to highlight and it will do the rest.
A Reader's Toolbox
The seo software highlights on keywords research to increase traffic of your website. Especially in the affiliate business, you need backups of your website so that in case of lost of data you can retrieve it. For starting a telecom related business you need pc phone for customer support with huge bandwidth and space of cheap hosting. In order to find a good server for hosting you should know best domain host must have minimum down time. Especially the wireless internet booster is necessary for boosting up your speed.
No comments:
Post a Comment