string s = "http://www.abc.com/aaa/bbbb/ccc/dddd/ttttt";
string[] ss = s.Split("/".ToCharArray());
把前面的加起历就是的
string[] ss = s.Split("/".ToCharArray());
把前面的加起历就是的
解决方案 »
- 想用listView 做一个餐饮软件前台开台界面,请高手指点
- WebClient上传文件,上传时间大于100秒是报异常
- 如何设置旺旺发送文本的颜色?
- 如何获取验证码的图片 对有验证码的网页进行Winform登陆?
- sql返回值出错??
- Form验证为什么只对第一次登录时有效,登录过后,再次打开这个站点时,它不通过登录页就直接进去了.
- 我想写个类似与msn一样的东西!!!
- The value of ESP was not properly saved across a function call
- 如何利用C#实现JScript中eval()的功能?
- .net中的ASP。net中的myhello例子的,myhello.dll是如何写的?
- 哪位大哥介绍点有关RTF格式的学习资料吧,想做个QQ发图传文件的东西
- 如何通过程序知道路由器的外网IP地址
str = str.Substring(0,str.LastIndexOf("/"));
1) 先将"dddd"在字符串中的索引用INDEXOF找出来, 2) 然后再取回从0开始到"dddd"索引为止的字符串就可以了啊
string str1,str2
str1="http://www.abc.com/aaa/bbbb/ccc/dddd/ttttt"
int local
local= str1.lastIndexOf("/");//找到“/”最后出现的位置
str2= str1.substring(0, local);//获得http://www.abc.com/aaa/bbbb/ccc/dddd
str = str.Substring(0,str.LastIndexOf("/"));
str = str.Substring(0,str.LastIndexOf("/"));
str = str.split('/')[7].ToString();
int kk = str.LastIndexOf("/")+1;
str = str.Substring(0,kk);这样得到的是“http://www.abc.com/aaa/bbbb/ccc/dddd/”