@Test public void snakeToCamelCase() throws Exception { assertEquals("HelloWorld!", Do.snakeToCamelCase("hello_wORld_!")); assertEquals("Hello", Do.snakeToCamelCase("hello_")); assertEquals("Hello", Do.snakeToCamelCase("hello")); assertEquals("Hello", Do.snakeToCamelCase("_hello")); }
public static String snakeToCamelCase(String snakeString) { StringBuilder b = new StringBuilder(); for(String s: snakeString.split("_") ) { if(s.length() > 0 ) { b.append(Character.toUpperCase(s.charAt(0))); b.append(s.substring(1, s.length()).toLowerCase()); } } return b.toString(); }
Do { public static String snakeToCamelCase(String snakeString) { StringBuilder b = new StringBuilder(); for(String s: snakeString.split("_") ) { if(s.length() > 0 ) { b.append(Character.toUpperCase(s.charAt(0))); b.append(s.substring(1, s.length()).toLowerCase()); } } return b.toString(); } }
Do { public static String snakeToCamelCase(String snakeString) { StringBuilder b = new StringBuilder(); for(String s: snakeString.split("_") ) { if(s.length() > 0 ) { b.append(Character.toUpperCase(s.charAt(0))); b.append(s.substring(1, s.length()).toLowerCase()); } } return b.toString(); }  }
Do { public static String snakeToCamelCase(String snakeString) { StringBuilder b = new StringBuilder(); for(String s: snakeString.split("_") ) { if(s.length() > 0 ) { b.append(Character.toUpperCase(s.charAt(0))); b.append(s.substring(1, s.length()).toLowerCase()); } } return b.toString(); }  static byte[] read(String fileName); static byte[] read(InputStream inputStream); static String readToString(InputStream inputStream); static A checkSame(A oldValue, B newValue, Runnable onChanged); static T sample(Collection source); static SecureRandom getRng(); static int randomInt(int max); static byte[] randomBytes(int length); static byte[] randomNegativeBytes(int length); static int randomIntInRange(int inclusiveMinimum, int inclusiveMaximum); static byte[] read(File f); static void waitFor(Supplier<Boolean> function); static void delay(long millis, Action action); static void later(Action action); static HashMap<String, Object> map(Object... args); static Collection<T> collection(Object x); static ArrayList<T> list(U x); static ArrayList<T> listOf(U... objects); static boolean deepEqualityTest(Object a, Object b); static byte[] decodeBase64(String base64); static DeferredResult inParallel(final Task task); static DeferredResult inParallel(final TaskWithoutResult task); static String bytesToHex(byte[] bytes); static String snakeToCamelCase(String snakeString); }
Do { public static String snakeToCamelCase(String snakeString) { StringBuilder b = new StringBuilder(); for(String s: snakeString.split("_") ) { if(s.length() > 0 ) { b.append(Character.toUpperCase(s.charAt(0))); b.append(s.substring(1, s.length()).toLowerCase()); } } return b.toString(); }  static byte[] read(String fileName); static byte[] read(InputStream inputStream); static String readToString(InputStream inputStream); static A checkSame(A oldValue, B newValue, Runnable onChanged); static T sample(Collection source); static SecureRandom getRng(); static int randomInt(int max); static byte[] randomBytes(int length); static byte[] randomNegativeBytes(int length); static int randomIntInRange(int inclusiveMinimum, int inclusiveMaximum); static byte[] read(File f); static void waitFor(Supplier<Boolean> function); static void delay(long millis, Action action); static void later(Action action); static HashMap<String, Object> map(Object... args); static Collection<T> collection(Object x); static ArrayList<T> list(U x); static ArrayList<T> listOf(U... objects); static boolean deepEqualityTest(Object a, Object b); static byte[] decodeBase64(String base64); static DeferredResult inParallel(final Task task); static DeferredResult inParallel(final TaskWithoutResult task); static String bytesToHex(byte[] bytes); static String snakeToCamelCase(String snakeString);  }