Skip to content

Instantly share code, notes, and snippets.

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

This comment has been minimized.

Copy link

mdunicorn 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.