Java String Camel Case camelCase(String text)

Here you can find the source of camelCase(String text)

Description

camel Case

License

Open Source License

Declaration

public static String camelCase(String text) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static String camelCase(String text) {
        StringBuilder sb = new StringBuilder();
        boolean nextTitle = false;

        for (char c : text.toCharArray()) {
            if (Character.isSpaceChar(c))
                nextTitle = true;/*from   ww  w .  j  a v a2  s . c  o m*/
            else if (nextTitle) {
                c = Character.toTitleCase(c);
                nextTitle = false;
            }
            sb.append(c);
        }
        return sb.toString();
    }
}

Related

  1. camelCase(String s)
  2. camelCase(String s)
  3. camelCase(String str)
  4. CamelCase(String str)
  5. camelCase(String string, boolean firstUpper)
  6. camelCase(String text)
  7. camelCase(String text)
  8. camelCase(String text)
  9. camelCased(String str)