Here you can find the source of asCamelifyGetMethod(String original)
public static String asCamelifyGetMethod(String original)
//package com.java2s; import java.util.regex.Matcher; import java.util.regex.Pattern; public class Main { public static final String GET = "get"; public static String asCamelifyGetMethod(String original) { return GET + camelify(original); }/* w w w . j av a 2 s .c o m*/ public static String camelify(String original) { if (original == null) return ""; StringBuilder builder = new StringBuilder(); Pattern p = Pattern.compile("[a-zA-Z0-9]+"); Matcher m = p.matcher(original); String word; while (m.find()) { word = m.group(); builder.append(capitalize(word)); } return builder.toString(); } private static String capitalize(String string) { if (string.length() > 1) return string.substring(0, 1).toUpperCase() + string.substring(1); return ""; } }