aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt
diff options
context:
space:
mode:
authorCalMWolfs <94038482+CalMWolfs@users.noreply.github.com>2023-10-21 22:56:53 +1100
committerGitHub <noreply@github.com>2023-10-21 13:56:53 +0200
commit526365859a27d54b7ea5c07c08b301650c15ea0e (patch)
treeddf772f564d85caf3dbe73c66c032affdf69281f /src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt
parenta98927303854058ad2d7a0d8bb88265c54139614 (diff)
downloadskyhanni-526365859a27d54b7ea5c07c08b301650c15ea0e.tar.gz
skyhanni-526365859a27d54b7ea5c07c08b301650c15ea0e.tar.bz2
skyhanni-526365859a27d54b7ea5c07c08b301650c15ea0e.zip
Backend: Serialise all constants and add repo error messages and status (#605)
Backend: Serialise all constants and add repo error messages and status #605
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt2
1 files changed, 2 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 187407cbf..802decbce 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt
@@ -18,9 +18,11 @@ object StringUtils {
private val playerChatPattern = "(?<important>.*?)(?:§[f7r])*: .*".toPattern()
private val chatUsernamePattern = "^(?:§\\w\\[§\\w\\d+§\\w] )?(?:(?:§\\w)+\\S )?(?<rankedName>(?:§\\w\\[\\w.+] )?(?:§\\w)?(?<username>\\w+))(?: (?:§\\w)?\\[.+?])?".toPattern()
private val whiteSpaceResetPattern = "^(?:\\s|§r)*|(?:\\s|§r)*$".toPattern()
+ private val whiteSpacePattern = "^\\s*|\\s*$".toPattern()
private val resetPattern = "(?i)§R".toPattern()
fun String.trimWhiteSpaceAndResets(): String = whiteSpaceResetPattern.matcher(this).replaceAll("")
+ fun String.trimWhiteSpace(): String = whiteSpacePattern.matcher(this).replaceAll("")
fun String.removeResets(): String = resetPattern.matcher(this).replaceAll("")
fun String.firstLetterUppercase(): String {