aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorLorenz <lo.scherf@gmail.com>2022-08-20 19:21:06 +0200
committerLorenz <lo.scherf@gmail.com>2022-08-20 19:21:06 +0200
commite8ae72d6b76ebee6eb5f3f37315d69e5a063926c (patch)
treeada119390c86cb5f866f90f2d88b9e7d25eb822f /src/main/java
parent4e78fef420e82428bc1d0e2a733d3b6bd03601ff (diff)
downloadskyhanni-e8ae72d6b76ebee6eb5f3f37315d69e5a063926c.tar.gz
skyhanni-e8ae72d6b76ebee6eb5f3f37315d69e5a063926c.tar.bz2
skyhanni-e8ae72d6b76ebee6eb5f3f37315d69e5a063926c.zip
i still cant regex
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt
index a28f6fd2e..7d68afea6 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt
@@ -11,7 +11,23 @@ object StringUtils {
}
fun String.removeColor(): String {
- return replace("(?i)\\u00A7.", "")
+// return replace("(?i)\\u00A7.", "")
+
+ val builder = StringBuilder()
+ var skipNext = false
+ for (c in this.toCharArray()) {
+ if (c == 'ยง') {
+ skipNext = true
+ continue
+ }
+ if (skipNext) {
+ skipNext = false
+ continue
+ }
+ builder.append(c)
+ }
+
+ return builder.toString()
}
// fun cleanColour(`in`: String): String? {