Java String Camel Case Format toCamelCase(String input)

Here you can find the source of toCamelCase(String input)

Description

to Camel Case

License

Open Source License

Declaration

public static String toCamelCase(String input) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2015 SAP and others.//  w w w  . j  a va2  s. c o m
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 * Contributors:
 * SAP - initial API and implementation
 *******************************************************************************/

public class Main {
    public static String toCamelCase(String input) {
        if (input == null) {
            return null;
        }
        StringBuffer result = new StringBuffer();
        result.append(input.substring(0, 1).toUpperCase());
        result.append(input.substring(1).toLowerCase());
        return result.toString();
    }
}

Related

  1. toCamelCase(String dashCase)
  2. toCamelCase(String id)
  3. toCamelCase(String in, boolean startWithUpper)
  4. toCamelCase(String input)
  5. toCamelCase(String input)
  6. toCamelCase(String input, boolean capitalizeFirsLetter)
  7. toCamelCase(String input, boolean firstCharUppercase, char separator)
  8. toCamelCase(String inputString)
  9. toCamelCase(String inputString)