Java tutorial
//package com.java2s; /* * Copyright (C) 2002-2014 FlyMine * * This code may be freely distributed and modified under the * terms of the GNU Lesser General Public Licence. This should * be distributed with the code. See the LICENSE file for more * information or http://www.gnu.org/copyleft/lesser.html. * */ public class Main { /** * Return the fragment portion of a URI string (i.e. everything after a #). * @param uri a uri string * @return the fragment or original uri if no # present */ public static String getFragmentFromURI(String uri) { if (uri.indexOf('#') > 0) { return uri.substring(uri.indexOf('#') + 1); } return uri; } }