Glenn Slaven
Glenn Slaven

Reputation: 34213

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

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?

Upvotes: 25

Views: 10808

Answers (1)

Stefan Dragnev
Stefan Dragnev

Reputation: 14473

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.

Upvotes: 13

Related Questions