Created
December 16, 2018 12:24
-
-
Save MarcBruins/208a523748c51d904cc95f19f16197a2 to your computer and use it in GitHub Desktop.
Return value for uri trailing slash
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() + "/"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In second method, did you mean:
?