Java tutorial
//package com.java2s; public class Main { private static String getResourceName(String resourceName) { String rn = new String(resourceName.substring(0, 1).toLowerCase() + resourceName.substring(1)); rn = rn.replaceAll(" ", ""); for (int i = 'A'; i <= 'Z'; i++) { char ch = (char) i; String s = new String(ch + ""); rn = rn.replaceAll(s, "_" + s.toLowerCase()); } return rn; } }