Java String Underscore toUnderscoreSeparated(String name)

Here you can find the source of toUnderscoreSeparated(String name)

Description

to Underscore Separated

License

Apache License

Declaration

public static String toUnderscoreSeparated(String name) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static String toUnderscoreSeparated(String name) {
        if (name == null) {
            return name;
        }//  w w  w .  ja v  a  2 s  . co m
        return name.replaceAll("([a-z])([A-Z])", "$1_$2").toLowerCase();
    }
}

Related

  1. toUnderScoreCase(String s)
  2. toUnderscored(String name)
  3. toUnderscoredLowercase(String text)
  4. toUnderscoreName(String name)
  5. toUnderscores(String s)
  6. underscore(final String s, final Locale locale)
  7. underscore(String camel)
  8. underscore(String camelCaseWord)
  9. underscore(String field)