Java String Underscore to underscoreDashToCamelCase(String s)

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

Description

underscore Dash To Camel Case

License

Open Source License

Declaration

public static String underscoreDashToCamelCase(String s) 

Method Source Code

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

public class Main {
    public static String underscoreDashToCamelCase(String s) {
        String[] parts = s.split("[_-]");
        StringBuilder builder = new StringBuilder();
        for (String part : parts) {
            builder.append(capitalized(part));
        }//from   www .j  a  va  2  s . c o m
        return builder.toString();
    }

    public static String capitalized(String s) {
        return s.substring(0, 1).toUpperCase() + s.substring(1);
    }
}

Related

  1. underscore2camel(String underscoreName)
  2. underScore2CamelCase(String strs)
  3. underscoresToCamelCaseImpl(String input, boolean capNextLetter)
  4. underscoresToSpaces(String value)
  5. underscoreToCamel(String input, boolean firstLetterUppercase)
  6. underscoreToCamelCase(String wordConstruct)