Hi,
Try this Code - Using Regex
public string HighlightText(string argText)
{
string Search_Str = hdnSearchText.Value.ToString();
Regex RegExp = new Regex(Search_Str.Replace(" ", "|").Trim(), RegexOptions.IgnoreCase);
return RegExp.Replace(argText, new MatchEvaluator(ReplaceKeyWords));
}
public string ReplaceKeyWords(Match m)
{
return ("" + m.Value + "");
}
protected void btnSearch_Click(object sender,EventArgs e)
{
string arg = txtSearch.Text;
string result = HighlightText(arg);
lblDisplay.Text = result;
}
Thanks
Siva Rm K