Change any String to camelcase string in android

by Thursday, November 21, 2013 0 comments
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);  
           }  

karthik nagarajan

Androider

Welcome to Android-Action Blog. I’m a normal guy, who is passionate about Mobile Coding. Here I am writing about Android. Happy learning

0 comments:

Post a Comment