diff options
author | appable <enzospiacitelli@gmail.com> | 2023-12-22 17:30:01 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-23 02:30:01 +0100 |
commit | 5e976a3a821f07b6f2cee7681c8ce98823cdd32a (patch) | |
tree | 130670a4fd49df8cba80dffd81dd3cc608c58087 /src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt | |
parent | 57a25df8326aa525cb35b84ca0dcce6985da2c5e (diff) | |
download | skyhanni-5e976a3a821f07b6f2cee7681c8ce98823cdd32a.tar.gz skyhanni-5e976a3a821f07b6f2cee7681c8ce98823cdd32a.tar.bz2 skyhanni-5e976a3a821f07b6f2cee7681c8ce98823cdd32a.zip |
improve composter empty time precision (#824)
Improve precision of compost empty timer. #824
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt index a9ac0ca82..9ac80f7f3 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt @@ -38,6 +38,12 @@ object StringUtils { private val formattingChars by lazy { "kmolnr".toCharArray() + "kmolnr".uppercase().toCharArray() } + /** + * Removes color and optionally formatting codes from the given string, leaving plain text. + * + * @param keepFormatting Boolean indicating whether to retain non-color formatting codes (default: false). + * @return A string with color codes removed (and optionally formatting codes if specified). + */ fun String.removeColor(keepFormatting: Boolean = false): String { val builder = StringBuilder(this.length) |