Java String Camel Case Format toCamelCase(String originalName)

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

Description

to Camel Case

License

Open Source License

Declaration

static String toCamelCase(String originalName) 

Method Source Code

//package com.java2s;

public class Main {
    static String toCamelCase(String originalName) {
        String[] words = originalName.split("-+");
        StringBuilder nameBuilder = new StringBuilder(originalName.length());
        for (String word : words) {
            if (nameBuilder.length() == 0) {
                nameBuilder.append(word);
            } else {
                nameBuilder.append(word.substring(0, 1).toUpperCase());
                nameBuilder.append(word.substring(1));
            }/*  w w w.j  ava 2s. c  om*/
        }
        return nameBuilder.toString();
    }
}

Related

  1. toCamelCase(String name)
  2. toCamelCase(String name)
  3. toCamelCase(String name)
  4. toCamelCase(String name)
  5. toCamelCase(String original)
  6. toCamelCase(String origString)
  7. toCamelCase(String s)
  8. toCamelCase(String s)
  9. toCamelCase(String s)