Here you can find the source of camelToSplitName(String camelName, String split)
public static String camelToSplitName(String camelName, String split)
//package com.java2s; /*/*from ww w .java 2 s. com*/ * Copyright 2009-2012 Evun Technology. * * This software is the confidential and proprietary information of * Evun Technology. ("Confidential Information"). You shall not * disclose such Confidential Information and shall use it only in * accordance with the terms of the license agreement you entered into * with evun.cn. */ public class Main { public static String camelToSplitName(String camelName, String split) { if (camelName == null || camelName.length() == 0) { return camelName; } StringBuilder buf = null; for (int i = 0; i < camelName.length(); i++) { char ch = camelName.charAt(i); if (ch >= 'A' && ch <= 'Z') { if (buf == null) { buf = new StringBuilder(); if (i > 0) { buf.append(camelName.substring(0, i)); } } if (i > 0) { buf.append(split); } buf.append(Character.toLowerCase(ch)); } else if (buf != null) { buf.append(ch); } } return buf == null ? camelName : buf.toString(); } }