Here you can find the source of camelToUpper(String camel)
Parameter | Description |
---|---|
camel | a parameter |
public static String camelToUpper(String camel)
//package com.java2s; //License from project: Open Source License public class Main { /**/*from w ww.j a v a 2 s . com*/ * Convert CamelCase strings to ALL_UPPERCASE_WITH_UNDERSCORES. * @param camel * @return */ public static String camelToUpper(String camel) { return camel.replaceAll("([A-Z][a-z0-9])", "_$1").substring(1).toUpperCase(); } }