package com.codewars.tocamelcase;

/**
 * MIT License
 * (c) 2017 Ricardo Constantino
 */

import java.lang.StringBuilder;

class Solution{

    public static void main(String[] args) {
        // returns "theStealthWarrior"
        System.out.println(toCamelCase("the-stealth-warrior"));

        // returns "TheStealthWarrior"
        System.out.println(toCamelCase("The_Stealth_Warrior"));
    }

    static String toCamelCase(String s){
        String[] split = s.split("[-_]");
        StringBuilder res = new StringBuilder();
        res.append(split[0]);
        for (int i = 1; i < split.length; i++) {
            res.append(split[i].toUpperCase().substring(0,1));
            res.append(split[i].substring(1));
        }
        return res.toString();
    }
}
