@Test public void camelStr2underLine() { String str1 = "camelStr2underLine"; String str2 = BeanUtil.camelStr2underLine(str1); Assert.equals(str2, "camel_str2under_line", ErrorCodeDef.SYSTEM_ERROR_10001); }
public static String camelStr2underLine(final String camelStr) { StringBuilder sb = new StringBuilder(camelStr); for (int i = 0; i < sb.length(); i++) { char c = sb.charAt(i); if (c >= 'A' && c <= 'Z') { sb.replace(i, i + 1, Character.toString((char) (c + MAX_CHAR))); sb.insert(i, GlobalConstants.UNDERLINE); i++; } } return sb.toString(); }
BeanUtil { public static String camelStr2underLine(final String camelStr) { StringBuilder sb = new StringBuilder(camelStr); for (int i = 0; i < sb.length(); i++) { char c = sb.charAt(i); if (c >= 'A' && c <= 'Z') { sb.replace(i, i + 1, Character.toString((char) (c + MAX_CHAR))); sb.insert(i, GlobalConstants.UNDERLINE); i++; } } return sb.toString(); } }
BeanUtil { public static String camelStr2underLine(final String camelStr) { StringBuilder sb = new StringBuilder(camelStr); for (int i = 0; i < sb.length(); i++) { char c = sb.charAt(i); if (c >= 'A' && c <= 'Z') { sb.replace(i, i + 1, Character.toString((char) (c + MAX_CHAR))); sb.insert(i, GlobalConstants.UNDERLINE); i++; } } return sb.toString(); }  }
BeanUtil { public static String camelStr2underLine(final String camelStr) { StringBuilder sb = new StringBuilder(camelStr); for (int i = 0; i < sb.length(); i++) { char c = sb.charAt(i); if (c >= 'A' && c <= 'Z') { sb.replace(i, i + 1, Character.toString((char) (c + MAX_CHAR))); sb.insert(i, GlobalConstants.UNDERLINE); i++; } } return sb.toString(); }  static boolean isAbstract(final Method method); static String[] getMethodParamNames(final Class<?> clazz, final String method, final Class<?>... paramTypes); static String[] getMethodParamNames(final Method method); static String getMethodSignature(final Method method); static Set<Class<?>> getClasses(final String pk); static String toUnderlineName(final String s); static String toCamelCase(final String str); static String camelStr2underLine(final String camelStr); static String toCapitalizeCamelCase(final String str); static boolean isSimpleValueType(final Class<?> clazz); static boolean isSimpleProperty(final Class<?> clazz); }
BeanUtil { public static String camelStr2underLine(final String camelStr) { StringBuilder sb = new StringBuilder(camelStr); for (int i = 0; i < sb.length(); i++) { char c = sb.charAt(i); if (c >= 'A' && c <= 'Z') { sb.replace(i, i + 1, Character.toString((char) (c + MAX_CHAR))); sb.insert(i, GlobalConstants.UNDERLINE); i++; } } return sb.toString(); }  static boolean isAbstract(final Method method); static String[] getMethodParamNames(final Class<?> clazz, final String method, final Class<?>... paramTypes); static String[] getMethodParamNames(final Method method); static String getMethodSignature(final Method method); static Set<Class<?>> getClasses(final String pk); static String toUnderlineName(final String s); static String toCamelCase(final String str); static String camelStr2underLine(final String camelStr); static String toCapitalizeCamelCase(final String str); static boolean isSimpleValueType(final Class<?> clazz); static boolean isSimpleProperty(final Class<?> clazz);  }