Let me correct my code. 

     /**

     * Convert a string to camel case

     */

    public static String toCamelCase(String string)

    {

        StringBuilder result = new StringBuilder();

 

        if (string.indexOf('_') == -1)

            return  Character.isDigit(string.charAt(0)) ? "_" + string : 
string;

        else

            for (String word : string.split("_"))

            {

 

                // Uppercase first letter of a word

                if (word.length() > 0)

                {

 

                    // [#82] - If a word starts with a digit, prevail the

                    // underscore to prevent naming clashes

                    if (Character.isDigit(word.charAt(0)))

                    {

                        result.append("_");

                    }

 

                    result.append(word.substring(0, 1).toUpperCase());

                    result.append(word.substring(1).toLowerCase());

                }
 
 
Thanks

-- 
You received this message because you are subscribed to the Google Groups "jOOQ 
User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to