Here you can find the source of decapitalize(String name)
Parameter | Description |
---|---|
name | The string to be made in camel case. |
public static String decapitalize(String name)
//package com.java2s; public class Main { /**/*w w w .ja v a 2 s . c o m*/ * Utility method to take a string and convert it to normal Java variable name * capitalization. * * @param name * The string to be made in camel case. * @return The camel case version of the string. */ public static String decapitalize(String name) { if (name == null || name.length() == 0) { return name; } int offset1 = Character.offsetByCodePoints(name, 0, 1); if (offset1 < name.length() && Character.isUpperCase(name.codePointAt(offset1))) return name; return name.substring(0, offset1).toLowerCase() + name.substring(offset1); } }