Files
ICD.Common.Utils/ICD.Common.Utils/UriUtils.cs
2018-05-15 13:29:24 -04:00

32 lines
543 B
C#

using System;
namespace ICD.Common.Utils
{
public static class UriUtils
{
/// <summary>
/// Attempts to parse the given URI string into a System.Uri instance.
/// </summary>
/// <param name="uri"></param>
/// <param name="output"></param>
/// <returns></returns>
public static bool TryParse(string uri, out Uri output)
{
output = null;
if (string.IsNullOrEmpty(uri))
return false;
try
{
output = new Uri(uri);
return true;
}
catch (UriFormatException)
{
return false;
}
}
}
}