Java String Underscore underscoreAndLowercase(String s)

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

Description

underscore And Lowercase

License

Open Source License

Declaration

private static String underscoreAndLowercase(String s) 

Method Source Code

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

public class Main {
    private static String underscoreAndLowercase(String s) {
        return s.replaceAll(String.format("%s|%s", "(?<=[A-Z])(?=[A-Z][a-z])", "(?<=[^A-Z])(?=[A-Z])"), "_")
                .toLowerCase();//from w  w w  .jav  a  2  s  .  c om
    }
}

Related

  1. underscore(String field)
  2. underscore(String phase)
  3. underscore(String str)
  4. underscore(String word)
  5. underscoreAllWhitespace(String str)
  6. underScoreBreakToCaseBreak (final String s)
  7. underscoreCase(String s)
  8. underScoreCase2CamelCase(String str)
  9. underscored(String string)