Java Object Type Case castUnderLine(String origin)

Here you can find the source of castUnderLine(String origin)

Description

cast Under Line

License

Apache License

Declaration

private static String castUnderLine(String origin) 

Method Source Code

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

public class Main {

    private static String castUnderLine(String origin) {
        String sa[] = origin.split("[_]");
        StringBuffer sb = new StringBuffer();
        for (int i = 0; i < sa.length; i++) {
            String s = firstUpper(sa[i]);
            sb.append(s);/*from  w  ww  .  j a v a 2  s  .com*/
        }
        return sb.toString();
    }

    public static String firstUpper(String s) {
        if (s.length() == 0)
            return "";
        char ch[];
        ch = s.toLowerCase().toCharArray();
        ch[0] = (char) (ch[0] - 32);
        String result = new String(ch);
        return result;
    }
}

Related

  1. castToClass_strict(Number valueIn, Class toClassIn)
  2. castToObject(Object value)
  3. castToPrimitive(Object value, String targetType)
  4. castTotal(boolean isDoubleQuote, String target)
  5. castToTypeOrNull(Object object, Class clazz)
  6. castValue(String value, Class clazz)
  7. castWithGenericsOrNull(Class base, Object obj)