blob: 38b87e795a297f28501e200433028b58b22acb63 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
package com.github.jodersky.mavlink
object StringUtils {
def camelify(str: String) = {
val lower = str.toLowerCase
"_([a-z\\d])".r.replaceAllIn(lower, {m => m.group(1).toUpperCase()})
}
def Camelify(str: String) = {
val camel = camelify(str)
val (head, tail) = camel.splitAt(1)
head.toUpperCase + tail
}
}
|