Path.Combine for URLs?

前端 未结 30 2435
不思量自难忘°
不思量自难忘° 2020-11-22 14:28

Path.Combine is handy, but is there a similar function in the .NET framework for URLs?

I\'m looking for syntax like this:

Url.Combine(\"http://MyUrl.         


        
30条回答
  •  刺人心
    刺人心 (楼主)
    2020-11-22 15:11

    Why not just use the following.

    System.IO.Path.Combine(rootUrl, subPath).Replace(@"\", "/")
    

提交回复
热议问题