Kotlin Multiplatform (Kotlin MPP aka KMP) implementation of pangu.js.
If your project is a Kotlin multiplatform project, add the dependency in build.gradle.kts
:
kotlin {
sourceSets {
val commonMain by getting {
dependencies {
implementation("io.github.darkokoa:pangu:<version>")
}
}
}
}
If your project is a(an) JVM or Android project:
dependencies {
implementation("io.github.darkokoa:pangu-jvm:<version>")
}
In Kotlin
// use Pangu singleton
val pendingText = "..."
val completedText = Pangu.spacingText(pendingText)
// use kotlin extension function
val pendingText = "..."
val completedText = pendingText.spacingText(pendingText)
In Java
// use Pangu singleton
String pendingText = "...";
String completedText = Pangu.INSTANCE.spacingText(pendingText);
// use PanguKt static class
String pendingText = "...";
String completedText = PanguKt.spacingText(pendingText);
- The processing time also becomes longer when you need to process longer text. Doing so will block the current thread for a long time. If the UI thread is blocked it means that the program may crash.
- Java support requires Java 8 or above.
Released under the MIT License.