Java String Camel Case Format toCamelCase(String s)

Here you can find the source of toCamelCase(String s)

Description

to Camel Case

License

Open Source License

Declaration

public static String toCamelCase(String s) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static String toCamelCase(String s) {
        String[] parts = s.split("_");
        String camelCaseString = "";
        for (String part : parts) {
            camelCaseString = camelCaseString + toFirstUpperCase(part);
        }/*w w w.  j  av a 2s .co  m*/
        return camelCaseString;
    }

    private static String toFirstUpperCase(String s) {
        return s.substring(0, 1).toUpperCase() + s.substring(1).toLowerCase();
    }
}

Related

  1. toCamelCase(String s)
  2. toCamelCase(String s)
  3. toCamelCase(String s)
  4. toCamelCase(String s)
  5. toCamelCase(String s)
  6. toCamelCase(String s)
  7. toCamelCase(String s)
  8. toCamelCase(String s, boolean firstCharUppercase)
  9. toCamelCase(String s, Boolean firstUpper)