Java String Camel Case To camelPrefix(String str, int prefixSize)

Here you can find the source of camelPrefix(String str, int prefixSize)

Description

camel Prefix

License

Open Source License

Declaration

public static String camelPrefix(String str, int prefixSize) 

Method Source Code

//package com.java2s;
/**/*www.  j  a  v  a2s  .c  o  m*/
 * Copyright 2004-2014 Riccardo Solmi. All rights reserved.
 * This file is part of the Whole Platform.
 *
 * The Whole Platform is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * The Whole Platform is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with the Whole Platform. If not, see <http://www.gnu.org/licenses/>.
 */

public class Main {
    public static String camelPrefix(String str, int prefixSize) {
        return prefixSize + 1 >= str.length() ? str
                : Character.isUpperCase(str.charAt(prefixSize)) ? str.substring(0, prefixSize + 2) + "\u2026"
                        : str.substring(0, prefixSize + 1) + "\u2026";
    }
}

Related

  1. camelCaseUnderscores(String str)
  2. camelHump(String str)
  3. camelHumpsToWords(String camelHumps)
  4. camelhumpToUnderline(String str)
  5. camelizeOneWord(String word, boolean firstLetterInLowerCase)
  6. camelToComposite(String camel)
  7. camelToFixedString(String str, String fixed)
  8. camelToLisp(final String pString)
  9. camelToLowerSnake(String camel)