Java Utililty Methods String Shorten

List of utility methods to do String Shorten

Description

The list of methods to do String Shorten are organized into topic(s).

Method

StringshortenURI(String uri)
shorten URI
if (uri.startsWith("http")) {
    uri = uri.substring(uri.indexOf('#') + 1);
return uri;
StringshortenUrl(String protocolHostPart, String pathPart, String queryPart, String fragmentIdentifier)
Shortens a URL.
StringBuilder url = new StringBuilder();
url.append(protocolHostPart);
StringBuilder pathQueryFragmentPart = new StringBuilder();
if (pathPart != null) {
    pathQueryFragmentPart.append(pathPart);
if (queryPart != null) {
    pathQueryFragmentPart.append(queryPart);
...
double[]ShortenVector(double[] vector, int new_length)
Shorten Vector
double[] result = new double[new_length];
for (int i = 0; i < new_length; i++) {
    result[i] = vector[i];
return result;
StringshortenXPathForPropertyExpansion(String xpath, String value)
shorten X Path For Property Expansion
if (xpath.length() > 0) {
    StringBuffer buf = new StringBuffer();
    for (int c = 0; c < xpath.length(); c++) {
        char ch = xpath.charAt(c);
        switch (ch) {
        case '\n':
            buf.append(' ');
            break;
...