Java examples for java.lang:String Contain
Converts a string containing an absolute path to a string containing a path relative
//package com.java2s; import java.io.File; public class Main { /**//from ww w . j a va 2 s . co m * Converts a string containing an absolute path to a string * containing a path relative to absPart. */ public final static String relativePath(String path, String absPart) { if (path.startsWith(absPart)) { path = path.substring(absPart.length()); if (path.startsWith(File.separator)) return path.substring(1); } // end if return path; } }