I am trying to implement this example
http://blog.evonet.com.au/post/Gridview-with-highlighted-search-results.aspx
but the only problem I am facing is the Ad
Based on the link you posted, I'm assuming that you want this:
Return ResultStr.Replace(InputTxt, New MatchEvaluator(AddressOf ReplaceWords))
.. in C#?
If so you don't need the AddressOf
keyword at all. MatchEvaluator
is a delegate type so you can simply pass over a method (ResultStr.Replace(InputTxt, ReplaceWords)
). Alternatively, you could use an anonymous method for this to reduce the code, which makes sense as it's not being used elsewhere:
return ResultStr.Replace(InputTxt, delegate(Match m) {
return "" + m.ToString() + "";
});