Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

public class Main {
    public static String toCamelCase(String tag) {
        String camel = "";
        for (int j = 0; j < tag.length(); j++) {
            char ch = tag.charAt(j);
            if (j == 0) {
                camel += Character.toUpperCase(ch);
            } else if (ch == '-') {
                camel += Character.toUpperCase(tag.charAt(j + 1));
                j++;
            } else {
                camel += ch;
            }
        }
        return camel;
    }
}