Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a URI equivalent of Path.PathSeparator in .NET?

Tags:

.net

uri

I need to build up a URI path from string values and I'm combining them together. Is there a URI constant for the / separator value as there is for Path.PathSeparator?

like image 216
Glenn Slaven Avatar asked Jul 13 '11 01:07

Glenn Slaven


1 Answers

Apparently there isn't. It's not platform-specific after all and RFC 2396 RFC 3986 specifies that the path separator in URIs is in fact /.

For combining URIs it's probably best to use the Uri(baseUrl, relativeUrl) constructor as suggested in Mike's comment.

like image 63
Stefan Dragnev Avatar answered Nov 08 '22 10:11

Stefan Dragnev