fork download
  1. import java.util.regex.Pattern;
  2.  
  3. public class Main {
  4. public static void main(String[] args) {
  5. String str = "snake_case_to_camel_case";
  6.  
  7. str = Pattern.compile("_([a-z])")
  8. .matcher(str)
  9. .replaceAll(m -> m.group(1).toUpperCase());
  10.  
  11. System.out.println(str);
  12. }
  13. }
Success #stdin #stdout 0.1s 55720KB
stdin
Standard input is empty
stdout
snakeCaseToCamelCase