diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-11-11 11:42:54 +0100 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-11-11 11:42:54 +0100 |
commit | 30b959a6da9e516cfb190554584b9a013c0412f7 (patch) | |
tree | 19bace1a369130c0ff0c4466ae3755e7e79c7d58 /src/main/java/at/hannibal2/skyhanni/utils | |
parent | 5477d22a05c366095f402de10c1e0b9b15e18320 (diff) | |
download | skyhanni-30b959a6da9e516cfb190554584b9a013c0412f7.tar.gz skyhanni-30b959a6da9e516cfb190554584b9a013c0412f7.tar.bz2 skyhanni-30b959a6da9e516cfb190554584b9a013c0412f7.zip |
Pablo Helper
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt | 9 |
1 files changed, 9 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 0900b3812..b60c08b6f 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt @@ -89,6 +89,15 @@ object StringUtils { } } + inline fun <T> List<Pattern>.matchMatchers(text: String, consumer: Matcher.() -> T): T? { + for (pattern in iterator()) { + pattern.matchMatcher<T>(text) { + return consumer() + } + } + return null + } + fun getColor(string: String, default: Int, darker: Boolean = true): Int { val stringPattern = "ยง[0123456789abcdef].*".toPattern() |