Skip to content

chattymin/Pebble

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

33 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Pebble GitHub License MIN SDK

Treat String Like A Pebble With Grapheme At Kotlin 🫧
The Easy Way To Use Emoji πŸš€

Why Pebble?

In Android, String is encoded in UTF-8, which means characters like emojis may not count as a single character.

"πŸš€".length == 2
"πŸ§‘β€πŸ§‘β€πŸ§’β€πŸ§’".length == 11

Many applications display the character count when users enter text, such as nicknames or posts.
However, due to certain issues, emojis are not counted correctly.

AS-IS TO-BE
image image

To address this inconvenience, Pebble Is Coming!

Gradle Settings

Add the codes below to your root build.gradle file (not your module-level build.gradle file):

allprojects {
    repositories {
        mavenCentral()
    }
}

And, Add the dependency below to your module build.gradle file:

dependencies {
    implementation("io.github.chattymin:pebble:0.1.0")
}


How To Use?

"πŸš€".graphemeLength == 1
"πŸš€".isEmoji() == true
"Hello Pebble πŸš€ Welcome!".containsEmoji() == true
"HelloπŸš€ This is Pebble!🫧 WelcπŸ§‘β€πŸ§‘β€πŸ§’β€πŸ§’ome :)".extractEmojis() == ["πŸš€", "🫧", "πŸ§‘β€πŸ§‘β€πŸ§’β€πŸ§’"]
"HelloπŸš€ This is Pebble!🫧 WelcπŸ§‘β€πŸ§‘β€πŸ§’β€πŸ§’ome :)".filterEmojis() == "Hello This is Pebble! Welcome :)"

In addition to this, various types of extension functions are also available.
The goal is to cover all ranges officially provided by Kotlin.

You can explore and use various extension functions within the Pebble module :)

Want To Contriubte

Contributions are always welcome!
Feel free to make an issue everything that you want to contribute!
Welcome New Extensions, Performance Improvements, and all ways of working with stringsβ€”just like Pebble!

CONTRIBUTING.md

Contributors

contributors

License

Copyright 2025 chattymin (Dongmin Park)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

About

Treat String Like A Pebble With Grapheme At Kotlin 🫧 The Easy Way To Use Emoji πŸš€

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages