日期:2014-05-20 浏览次数:20606 次
public static String ps(String s) { String rs=s.replaceAll("([A-Z])", "_$1"); return s.charAt(0)=='_'?rs.toUpperCase():rs.substring(1).toUpperCase(); } public static void main(String[] args) throws Exception { // TODO Auto-generated method stub System.out.println("ScanSite=>"+ps("ScanSite")+"\n"+ "ScanType=>"+ps("ScanType")+"\n"+ "SendSite=>"+ps("SendSite")); }