aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt
index 7c8e68a87..877e0edf6 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt
@@ -1,10 +1,10 @@
package at.hannibal2.skyhanni.utils
+import org.intellij.lang.annotations.Language
import java.text.DecimalFormat
import java.util.*
object StringUtils {
-
private val durationFormat = DecimalFormat("00")
fun String.firstLetterUppercase(): String {
@@ -92,6 +92,7 @@ object StringUtils {
return toString().replace("-", "")
}
-}
+ fun String.matchRegex(@Language("RegExp") regex: String): Boolean = regex.toRegex().matches(this)
-private fun String.removeAtBeginning(text: String): String = if (this.startsWith(text)) substring(text.length) else this
+ private fun String.removeAtBeginning(text: String): String = if (this.startsWith(text)) substring(text.length) else this
+}