截取linux文件存储路径方法

1.截取linux文件存储路径方法

package com.tydic.eshop.action.freemarker;

public class dddd {

    public static void main(String[] args) {
String strParentUrl = "/home/tomcat7/ecp/t8086/webapps/ecp/FreeMarker/1463766670142/error/html/index.html";
String[] s = strParentUrl.split("/");
String ddd = display(s,8,s.length);
System.out.println(ddd); } public static String display(String[] str,int a,int b) {
StringBuffer sb = new StringBuffer();
for(int i=a;i<b;i++) {
sb.append("/"+str[i]);
}
String requestString = sb.toString().substring(1, sb.toString().length());
return requestString; }
}
上一篇:KMP求字符串最小循环节


下一篇:composer在update时提示file could not be downloaded: SSL operation failed with code 1. OpenSSL Error messages: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO