Here you can find the source of underScoreBreakToCaseBreak (final String s)
public static String underScoreBreakToCaseBreak (final String s)
//package com.java2s; // Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file import java.util.Arrays; public class Main { public static String underScoreBreakToCaseBreak(final String s) { // Logical name is the physical name converted to mixed case, eg ACTUAL_DATA to // ActualData. final StringBuilder sb = new StringBuilder(); final char[] chars = s.toCharArray(); boolean nextShouldBeUpperCase = true; for (final char c : chars) { if (c == '_') { // Separator. Cause a case break. nextShouldBeUpperCase = true; } else if (c == '$' || !Character.isJavaIdentifierPart(c)) { // Translate illegal computer language characters to '_' and cause a case // break. sb.append('_'); nextShouldBeUpperCase = true; } else if (nextShouldBeUpperCase) { sb.append(Character.toUpperCase(c)); nextShouldBeUpperCase = false; } else { sb.append(Character.toLowerCase(c)); }//from w w w .j ava 2s .co m } return sb.toString(); } /** Varargs wrapper */ public static String toString(final Object... objects) { return Arrays.toString(objects); } }