Android examples for java.lang:String Case
convert string separated by underscore To Camel Case
public class Main{ public static String convertToCamelCase(String input) { String[] parts = input.split("_"); String camelCaseString = ""; for (int i = 0; i < parts.length; i++) { String part = parts[i]; camelCaseString = camelCaseString + ((i == 0) ? part.toLowerCase() : toProperCase(part)); // camelCaseString = camelCaseString + toProperCase(part); }// w w w .j a va 2s . c o m return camelCaseString; } }