kase-format alternatives and similar libraries
Based on the "Misc" category.
Alternatively, view kase-format alternatives based on common mentions on social networks and blogs.
-
jclasslib
jclasslib bytecode viewer is a tool that visualizes all aspects of compiled Java class files and the contained bytecode. -
kotlin-logging
Lightweight logging framework for Kotlin. Used as a wrapper for slf4j with Kotlin extensions. -
klock
Consistent and portable date and time utilities for multiplatform kotlin (JVM, JS and Common). -
kotlin-telegram-bot
A wrapper for the Telegram Bot API written in Kotlin. -
kotlinx.reflect.lite
Lightweight library allowing to introspect basic stuff about Kotlin symbols. -
Humanizer.jvm
Humanizer.jvm meets all your jvm needs for manipulating and displaying strings, enums, dates, times, timespans, numbers and quantities. -
actions-on-google-kotlin
Port of official Node.js SDK to Kotlin. Complete with all features and tests and nearly identical API. -
klutter
A mix of random small libraries for Kotlin, the smallest reside here until big enough for their own repository. -
SimpleDNN
SimpleDNN is a machine learning lightweight open-source library part of KotlinNLP and has been designed to support relevant neural network architectures in natural language processing tasks. -
kassava
This library provides some useful kotlin extension functions for implementing toString() and equals() without all of the boilerplate. -
kotlin-futures
A collections of extension functions to make the JVM Future, CompletableFuture, ListenableFuture API more functional and Kotlin like. -
kasechange
Multiplatform Kotlin library to convert strings between various case formats including Camel Case, Snake Case, Pascal Case and Kebab Case -
PrimeCalendar
Provides all of the java.util.Calendar functionalities for Civil, Persian, Hijri, Japanese, etc, as well as their conversion to each other.
Get performance insights in less than 4 minutes
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest. Visit our partner's website for more details.
Do you think we are missing an alternative of kase-format or a related project?
README
KaseFormat
Multiplatform kotlin string case conversion and detection library.
[examples](gifs/examples.gif)
(Inspired by Guava's CaseFormat
)
Setup
Declare repository
Include the following in your respositories
block within the build.gradle.kts
:
repositories {
maven("https://dl.bintray.com/dotcipher/maven")
}
Or in groovy syntax for a build.gradle
:
repositories {
maven {
url 'https://dl.bintray.com/dotcipher/maven'
}
}
Include dependency
Include the following in your dependencies block (replacing <version>
with the latest release above:
dependencies {
// JVM implementation
implementation("io.dotcipher.kase:kase-format-jvm:<version>")
// Native / JS implementations coming soon
}
Usage
KaseFormat
is the main entrypoint for library usage, and it's defined as an enum
of the following formats:
LOWER_HYPHEN
(ie.hello-world
)CAPITAL_HYPHEN
(ie.Hello-World
)UPPER_HYPHEN
(ie.HELLO-WORLD
)LOWER_UNDERSCORE
(ie.hello_world
)CAPITAL_UNDERSCORE
(ie.Hello_World
)UPPER_UNDERSCORE
(ie.HELLO_WORLD
)LOWER_CAMEL
(ie.helloWorld
)CAPITAL_CAMEL
(ie.HelloWorld
)
Conversion
The most efficient way to convert is if the source format is known before conversion.
For example, if the intent is to convert from LOWER_UNDERSCORE
(ie. hello_world
) to
CAPITAL_CAMEL
(ie. HelloWorld
) then you could use the following syntax:
val str = "hello_world"
val output = KaseFormat.LOWER_UNDERSCORE.convert(KaseFormat.CAPITAL_CAMEL, str)
// output == "HelloWorld"
If the source format isn't known before conversion, then a KaseConverter
needs to be
created targeting the destination format. The KaseConverter
can be reused and is thread-safe.
For example if the intent is to convert into the LOWER_HYPHEN
format from any unknown format then
you can use the following syntax:
val strings = listOf("string_one", "STRING-TWO", "stringThree", "StringFour")
val converter = KaseFormat.LOWER_HYPHEN.converter()
val firstOutput = converter.convert(strings[0])
// firstOutput == "string-one"
val listOutput = converter.convert(strings.sublist(1, strings.size))
// listOutput == listOf("string-two", "string-three", "string-four")
Detection
Detection of what format a string might be (by best guess), can be accomplished using the following syntax:
val str = "someString"
val format = KaseFormat.determine(str)
// format == LOWER_CAMEL