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("+", "-");
精彩评论