def camel(s: String, i: Int = 0, state: Int = 0): String = { if (i >= s.length) "" else { val c = s.charAt(i) c match { case '_' => camel(s, i+1, (state + 1) & 2) case _ => (if (state == 2) c.toUpper else c) + camel(s, i+1, 1) } }}