日期:2014-05-18 浏览次数:20557 次
string str = "Ads3+3/df?2%rf"; str= Regex.Replace(str, @"([^\+]+)\+([^\/]+)/([^\?+]+)\?([^\%]+)%(.+)", "$1%2B$2%2F$3%3F$4%25$5");
------解决方案--------------------
string str = "Ads3+3/df?2%rf"; str = Regex.Replace(Regex.Replace(Regex.Replace(Regex.Replace(str , "%", "%25"), @"\+", "%2B"), @"/", "%2F"), @"\?", "%3F");