List of utility methods to do String Shorten
String | shortenURI(String uri) shorten URI if (uri.startsWith("http")) { uri = uri.substring(uri.indexOf('#') + 1); return uri; |
String | shortenUrl(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; |
String | shortenXPathForPropertyExpansion(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; ... |