Aug. 10th, 2022

juan_gandhi: (Default)
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)
}
}
}

Profile

juan_gandhi: (Default)
Juan-Carlos Gandhi

October 2025

S M T W T F S
    1 23 4
5 678 91011
12131415161718
19202122232425
262728293031 

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Oct. 10th, 2025 07:24 am
Powered by Dreamwidth Studios