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;
             
             
        }
}

 

相关文章:

  • 2021-06-09
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-31
  • 2021-10-17
  • 2022-01-17
  • 2022-12-23
猜你喜欢
  • 2021-09-07
  • 2021-06-07
  • 2022-12-23
  • 2021-11-25
  • 2022-12-23
  • 2022-12-23
  • 2022-02-09
相关资源
相似解决方案