开发者

Rewrite rule to replace all + with -

My url contains all' + 's like path/My+Property+Details but I need to replace 开发者_运维知识库all + with '-'.and make it:

path/My-Property-Details.


Use String.Replace(..), like so:

string s = "path/My+Property+Details";
s = s.Replace("+", "-");

Don't forget the assignment because a string is immutable.


Use String.Replace.

url = url.Replace("+", "-");


Try this:

string newURL = oldUrl.Replace("+", "-");
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜