IsValidUrl

public static class MyExtensionMethods {
        public static bool IsValidUrl(this string text) {
            Regex rx = new Regex(@"http(s)?://([\w-]+\.)+[\w-]+(/[\w- ./?%&=]*)?");
            return rx.IsMatch(text);
        }
    }
}
Example:
test
test
test

Description

Returns true when a string is a valid url

Details

Double click on the code to select all.

 

;