Java tutorial
//package com.java2s; /* * Copyright (c) 2012. betterFORM Project - http://www.betterform.de * Licensed under the terms of BSD License */ public class Main { /** * Checks wether the specified path expression is a self reference and * strips the self referencing expression portion. * * @param path the path expression. * @return the stripped path expression if the specified path path is * a self reference, otherwise the unmodified path expression. */ public static String stripSelfReference(String path) { if (path != null && path.startsWith("./")) { // strip self reference return path.substring(2); } // leave unmodified return path; } }