将字符创“C://aa//b.text”转化为"http://10.11.22.33/a/b.text"怎么转换? 如题 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 String s = "C://aa//b.text";s.Replace("//","/");s.Replace("C:","http://10.11.22.33");是这意思么? string text = "C://aa//b.text"; string s=System.Text.RegularExpressions.Regex.Replace(text,@"(C://aa//)(\w+).text","http://10.11.22.33/a/$2.text",System.Text.RegularExpressions.RegexOptions.IgnoreCase);Response.Write(s); 前面盘符路径不固定的话就这样:string text = "C://aa//b.text"; string s=System.Text.RegularExpressions.Regex.Replace(text,@"([A-Za-z]://)([^/]\w+//)+(\w+).text","http://10.11.22.33/a/$3.text",System.Text.RegularExpressions.RegexOptions.IgnoreCase);Response.Write(s); Repeater 怎么清空内容 DateDiff问题 字体图片效果, GridView 更新问题!50分! 请教JS的一些基本概念 求正则表达试 这是一段Soap定义来调WebService的XML,其中有两个参数insertXML,updateXML当insertXML也是一段XML文档时就出错啦.有没有办法解决? 求一个匹配 decimal 类型的正则表达式! 挑战1流高手!!!最后30分全放! 那位高人给我帮个忙! 急急急 net 如何发送和接收邮件 asp.net1.1 和 asp.net2.0共存的情况下,我如何让新建立的站点默认支持asp.net2.0
s.Replace("//","/");
s.Replace("C:","http://10.11.22.33");
是这意思么?
string text = "C://aa//b.text";
string s=System.Text.RegularExpressions.Regex.Replace(text,@"(C://aa//)(\w+).text","http://10.11.22.33/a/$2.text",System.Text.RegularExpressions.RegexOptions.IgnoreCase);
Response.Write(s);
string s=System.Text.RegularExpressions.Regex.Replace(text,@"([A-Za-z]://)([^/]\w+//)+(\w+).text","http://10.11.22.33/a/$3.text",System.Text.RegularExpressions.RegexOptions.IgnoreCase);
Response.Write(s);