Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Return value for uri trailing slash
public static Uri EnsureTrailingSlash(Uri uri)
{
return new Uri(uri.ToString() + "/");
}
//OR
public static Uri EnsureTrailingSlash(Uri? uri)
{
if(uri == null)
return null;
return new Uri(uri.ToString() + "/");
}
@mdunicorn

This comment has been minimized.

Copy link

commented Feb 13, 2019

In second method, did you mean:

public static Uri? ...

?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.