Java String Remove removeGenericQuote(String str)

Here you can find the source of removeGenericQuote(String str)

Description

Transform a string from "java.util.List<String>" to "java.util.List"

License

Apache License

Parameter

Parameter Description
str a parameter

Declaration

public static String removeGenericQuote(String str) 

Method Source Code

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

public class Main {
    /**//from  w  w w. j  a v  a2s. com
     * Transform a string from "java.util.List&lt;String&gt;" to
     * "java.util.List"
     * 
     * @param str
     * @return
     */
    public static String removeGenericQuote(String str) {
        if (str == null) {
            return null;
        }

        // is a generic type
        if (str.charAt(str.length() - 1) == '>') {
            int lt = str.lastIndexOf('<');
            return str.substring(0, lt);
        }

        return str;
    }
}

Related

  1. removeExtraSpacesAndSpecialCharacters(String toSearch, boolean setAllToLowerCase)
  2. removeField(BSONObject b, String fieldName)
  3. removeFillers(String str)
  4. removeFromSearchPath(String _path)
  5. removeGender(String pos)
  6. removeIllegalXMLChars(String in)
  7. removeImportClass(String className)
  8. removeKeyPrefix(Properties properties, String prefix)
  9. removeModuleReference(String allStr, String refStr)