Skip to content

KenjiOhtsuka/kotlin-case-changer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kotlin Case Changer

Extension methods to make String to snake/camel case.

CircleCI

Twitter Follow

Usage

In Kotlin

"ABC".toSnakeCase() // => "a_b_c"
"a_b_c".toCamelCase() // => "ABC"
"abc".beginWithUpperCase() // => "Abc"
"Abc".beginWithLowerCase() // => "abc"

In Java

CaseChanger.toSnakeCase("ABC") // => "a_b_c"
CaseChanger.toCamelCase("a_b_c") // => "ABC"
CaseChanger.beginWithUpperCase("abc") // => "Abc"
CaseChanger.beginWithLowerCase("Abc") // => "abc"

Install

repositories {
  maven { url 'https://jitpack.io' }
}
dependencies {
  compile 'com.github.KenjiOhtsuka:kotlin-case-changer:0.1.1'
}