if given string is a keyword it will be replaced with none keyword

@param str
@return corrected word
971110
private static String correctReservedWord(String str) {
	char first = str.charAt(0);

	switch (first) {
	case 'a':
	    if (str.equals("abstract")) return "_" + str;
	    break;
	case 'b':
	    if (str.equals("boolean")) return "_" + str;
	    else if (str.equals("break")) return "_" + str;
	    else if (str.equals("byte")) return "_" + str;
	    break;
	case 'c':
	    if (str.equals("case")) return "_" + str;
	    else if (str.equals("catch")) return "_" + str;
	    else if (str.equals("char")) return "_" + str;
	    else if (str.equals("const")) return "_" + str;
	    else if (str.equals("class")) return "_" + str;
	    else if (str.equals("continue")) return "_" + str;
	    break;
	case 'd':
	    if (str.equals("default")) return "_" + str;
	    else if (str.equals("do")) return "_" + str;
	    else if (str.equals("double")) return "_" + str;
	    break;
	case 'e':
	    if (str.equals("else")) return "_" + str;
	    else if (str.equals("extends")) return "_" + str;
	    else if (str.equals("enum")) return "_" + str;
	    break;
	case 'f':
	    if (str.equals("false")) return "_" + str;
	    else if (str.equals("final")) return "_" + str;
	    else if (str.equals("finally")) return "_" + str;
	    else if (str.equals("float")) return "_" + str;
	    else if (str.equals("for")) return "_" + str;
	    break;
	case 'g':
	    if (str.equals("goto")) return "_" + str;
	    break;
	case 'i':
	    if (str.equals("if")) return "_" + str;
	    else if (str.equals("implements")) return "_" + str;
	    else if (str.equals("import")) return "_" + str;
	    else if (str.equals("instanceof")) return "_" + str;
	    else if (str.equals("int")) return "_" + str;
	    else if (str.equals("interface")) return "_" + str;
	    break;
	case 'n':
	    if (str.equals("native")) return "_" + str;
	    else if (str.equals("new")) return "_" + str;
	    else if (str.equals("null")) return "_" + str;
	    break;
	case 'p':
	    if (str.equals("package")) return "_" + str;
	    else if (str.equals("private")) return "_" + str;
	    else if (str.equals("protected")) return "_" + str;
	    else if (str.equals("public")) return "_" + str;
	    break;
	case 'r':
	    if (str.equals("return")) return "_" + str;
	    break;
	case 's':
	    if (str.equals("short")) return "_" + str;
	    else if (str.equals("static")) return "_" + str;
	    else if (str.equals("strictfp")) return "_" + str;
	    else if (str.equals("super")) return "_" + str;
	    else if (str.equals("switch")) return "_" + str;
	    else if (str.equals("synchronized")) return "_" + str;
	    break;
	case 't':
	    if (str.equals("this")) return "_" + str;
	    else if (str.equals("throw")) return "_" + str;
	    else if (str.equals("throws")) return "_" + str;
	    else if (str.equals("transient")) return "_" + str;
	    else if (str.equals("true")) return "_" + str;
	    else if (str.equals("try")) return "_" + str;
	    break;
	case 'v':
	    if (str.equals("void")) return "_" + str;
	    else if (str.equals("volatile")) return "_" + str;
	    break;
	case 'w':
	    if (str.equals("while")) return "_" + str;
	    break;
	}
	return str;

    }
1185211
public static String lcFirst(String str) {
	if (str == null) return null;
	else if (str.length() <= 1) return str.toLowerCase();
	else {
	    return str.substring(0, 1).toLowerCase() + str.substring(1);
	}
    }
1065145
public static String replace(String str, String search, String replace) {
        if (str == null || search == null || replace == null) {
            return str;
        }
        StringBuilder sb = new StringBuilder();
        int searchLen = search.length();
        int stringLen = str.length();
        int oldIndex = 0;
        int index;
        while ((index = str.indexOf(search, oldIndex)) >= 0) {
            sb.append(str, oldIndex, index);
            sb.append(replace);
            oldIndex = index + searchLen;
        }
        if (oldIndex < stringLen) {
            sb.append(str, oldIndex, stringLen);
        }
        return sb.toString();
    }
1182987
public static int getStringCase(String str) {
        if (str.length() == 0) {
            return MIXED;
        }

        int state = -1;

        char ch = str.charAt(0);
        if (Character.isLetter(ch)) {
            if (Character.isUpperCase(ch)) {
                state = UPPER_CASE;
            } else {
                state = LOWER_CASE;
            }
        }

        for (int i = 1; i < str.length(); i++) {
            ch = str.charAt(i);
            if (!Character.isLetter(ch)) {
                continue;
            }

            switch (state) {
                case UPPER_CASE:
                    if (Character.isLowerCase(ch)) {
                        if (i == 1) {
                            state = TITLE_CASE;
                        } else {
                            return MIXED;
                        }
                    }
                    break;
                case LOWER_CASE:
                case TITLE_CASE:
                    if (Character.isUpperCase(ch)) {
                        return MIXED;
                    }
                    break;
            }
        }

        return state;
    }
548613
@Trivial
    public static final String normalizeString(String str) {
        return (str == null || str.length() == 0) ? " " : str;
    }
593134
public static RegExpr createKeyword(String str) {
        int i;
        RegExpr[] chars;

        if (str.length() == 1) {
            return new Range(str.charAt(0));
        } else {
            chars = new RegExpr[str.length()];
            for (i = 0; i < chars.length; i++) {
                chars[i] = new Range(str.charAt(i));
            }
            return new Sequence(chars);
        }
    }
658997
String convertCase(String str) {
        if (str == null) {
            return null;
        }
        return sensitive ? str : str.toLowerCase();
    }
1295321
public Matcher getMatcher(String str) {
                Matcher m;
                if (matchers.containsKey(str)) {
                        m = matchers.get(str);
                } else {
                        m = p.matcher(str);
                        matchers.put(str, m);
                }
                return m;
        }
419149
public static String rearstring(final String str, final int reverseIndex) {
        assertStringNotNull(str);
        if (str.length() < reverseIndex) {
            String msg = "The length of the string was smaller than the index:";
            msg = msg + " str=" + str + " reverseIndex=" + reverseIndex;
            throw new StringIndexOutOfBoundsException(msg);
        }
        return str.substring(str.length() - reverseIndex);
    }
1369961
public static String replaceNonAlphanumeric(final String str, final char subst) {
        final StringBuffer ret = new StringBuffer(str.length());
        final char[] testChars = str.toCharArray();
        for (final char testChar : testChars) {
            if (Character.isLetterOrDigit(testChar)) {
                ret.append(testChar);
            } else {
                ret.append(subst);
            }
        }
        return ret.toString();
    }
904930
function strToBoolean(str) {
    switch (str && str.toLowerCase && str.toLowerCase()) {
        case 'true':
            return true;
        case 'false':
            return false;
        case 'null':
            return null;
    }
    return undefined;
}
490187
static public String replaceString(String str, String strReplace,
			String strWith) {
		StringBuffer sb = new StringBuffer();
		int iCurrent = 0;
		int iFound;
		int iReplaceLen = strReplace.length();

		if (str == null || strReplace == null || strWith == null)
			return str;
		if (str.equals("") || strReplace.equals(""))
			return str;

		while (true) {
			iFound = str.indexOf(strReplace, iCurrent);
			if (iFound == -1) {
				sb.append(str.substring(iCurrent));
				break;
			}

			if (iFound != iCurrent)
				sb.append(str.substring(iCurrent, iFound));
			sb.append(strWith);
			iCurrent = iFound + iReplaceLen;
		}

		return sb.toString();
	}
792747
public static String fixDBString(String str, int dbLen, int n) {
		if (str == null) {
			return "";
		}

		char[] chars = str.toCharArray();
		int len = 0;
		StringBuffer sb = new StringBuffer();

		for (int i = 0; i < chars.length; i++) {
			if (Character.UnicodeBlock.of(chars[i]) == Character.UnicodeBlock.BASIC_LATIN) {
				len++;
			} else {
				len += n;
			}
			if (len > dbLen) {
				break;
			}
			sb.append(chars[i]);
		}

		return sb.toString();
	}
1054813
private boolean nob(String str, Pattern p) {
		return str==null || !p.matcher(str).matches(); 
	}
92320
public static String quoteEscaped(final String str) {
        if (N.isNullOrEmpty(str)) {
            return str;
        }

        final StringBuilder sb = Objectory.createStringBuilder();
        final char[] chars = getCharsForReadOnly(str);

        try {
            char ch = 0;
            for (int i = 0, len = str.length(); i < len; i++) {
                ch = chars[i];

                if ((ch == _BACKSLASH) && (i < (len - 1))) {
                    sb.append(ch);
                    sb.append(str.charAt(++i));
                } else if ((ch == _QUOTATION_S) || (ch == _QUOTATION_D)) {
                    sb.append(_BACKSLASH);
                    sb.append(ch);
                } else {
                    sb.append(ch);
                }
            }

            return sb.toString();
        } finally {
            Objectory.recycle(sb);
        }
    }
208897
private static String decode(final String str) {
        if (str == null) {
            return null;
        }

        for (int i = 0; i < str.length(); ++i) {
            if (str.charAt(i) == '%') {
                return decode(str, i);
            }
        }

        return str;
    }
481623
public static final boolean toBoolean(String str, boolean trueIfNull) {
        if (str == null && trueIfNull) {
            return true;
        }

        return toBoolean(str);
    }