September 13th, 2012, 07:31 AM
Is there a way of disabling a link with C# if a # is used within the link
September 22nd, 2012, 02:34 PM
First, where is this link? On a webpage in a webbrowser control? I don't understand. I can't assume anything here yet.
Use Regex and remove all that match a link href for "#".
October 2nd, 2012, 09:00 AM
Sorry for the late response the links are on the webpage, how would I go about using RegularExpressions to remove these from webpage?
October 2nd, 2012, 08:04 PM
Here's a quick example i've put together for you.
private void MainMethod()
string html = "this is a test <a href=\"#\"># LINK</a> to see...<a href=\"http://www.link.com\">REGULAR LINK</a> ";
string s = Regex.Replace(html, "<.*?href=\"#\".*?>(.*?)</a>", new MatchEvaluator(MatchEval), RegexOptions.IgnoreCase);
private static string MatchEval(Match m)