using System.Collections.Generic;
public static void Main()
var tests = new List<string> {
"https://twitter.com/test",
"http://twitter.com/test",
"https://twitter.com/test?hello=hello",
foreach (var test in tests)
Console.WriteLine(string.Format("{0}: {1}", test, IsValidUri(test)));
public static bool IsValidUri(string uri)
Uri myUri = new Uri(uri);
Console.WriteLine(myUri.AbsolutePath);
return Uri.IsWellFormedUriString(uri, UriKind.Absolute);