Created
March 15, 2017 11:19
-
-
Save tateisu/17d54e0f0d56ddd0d8ad8271ef17b2e0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static String toCamelCase(String src){ | |
StringBuilder sb = new StringBuilder(); | |
for( String s : src.split( "_" ) ){ | |
if(TextUtils.isEmpty( s )) continue; | |
sb.append( Character.toUpperCase( s.charAt( 0 ) ) ); | |
sb.append( s.substring( 1, s.length() ).toLowerCase() ); | |
} | |
return sb.toString(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment