Java Java String Format toJava(String name)

Here you can find the source of toJava(String name)

Description

to Java

License

Open Source License

Declaration

public static String toJava(String name) 

Method Source Code

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

public class Main {
    public static String toJava(String name) {
        String out = "";
        boolean nextUpper = false;
        for (int i = 0; i < name.length(); i++) {
            char next = name.charAt(i);
            if (next == '-') {
                nextUpper = true;/*from  w  w  w  .j av  a 2 s.c  o  m*/
            } else {
                if (nextUpper) {
                    next = Character.toUpperCase(next);
                }
                out += next;
                nextUpper = false;
            }
        }

        return out;
    }
}

Related

  1. convertToJavaClassname(final String classname, final Map replacement)
  2. convertToJavaIdentity(String original, boolean firstCharacterUpperCase, boolean normalize)
  3. convertToJavaUnicode(String input, Character start1, Character end1, Character start2, Character end2)
  4. toJava(CharSequence str)
  5. toJava(final double[] doubles)
  6. toJava(String text)
  7. toJAVA(String unicode)
  8. toJavaBeanPropertyName(String prop)
  9. toJavaBool(byte goBool)