Java String Shorten shortenURI(String uri)

Here you can find the source of shortenURI(String uri)

Description

shorten URI

License

Apache License

Return

the local part of the full URI

Declaration

public static String shortenURI(String uri) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    /**//  w ww . j  a  v  a  2 s.c o  m
     *
     * @return the local part of the full URI
     */
    public static String shortenURI(String uri) {
        if (uri.startsWith("http")) {
            uri = uri.substring(uri.indexOf('#') + 1);
        }
        return uri;
    }
}

Related

  1. shortenText(String string, int threshold)
  2. shortenTo(final String value, final int maxLength)
  3. shortenTo(String string, int lenght)
  4. shortenToFirstLast(String filename)
  5. shortenType(String typeText)
  6. shortenUrl(String protocolHostPart, String pathPart, String queryPart, String fragmentIdentifier)
  7. ShortenVector(double[] vector, int new_length)
  8. shortenXPathForPropertyExpansion(String xpath, String value)