Convert any of String to Camelcase String in android by using this code...
public static String toCamelCase(String s){
boolean cap = true;
char[] out = s.toCharArray();
int i, len = s.length();
for(i=0; i<len; i++){
if(Character.isWhitespace(out[i])){
cap = true;
continue;
}
if(cap){
out[i] = Character.toUpperCase(out[i]);
cap = false;
}
}
return new String(out);
}
0 comments:
Post a Comment