aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt
blob: a28f6fd2ebb3de92c57f41e74509c1b0b44a57ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package at.hannibal2.skyhanni.utils

object StringUtils {

    fun String.firstLetterUppercase(): String {
        if (isEmpty()) return this

        val lowercase = this.lowercase()
        val first = lowercase[0].uppercase()
        return first + lowercase.substring(1)
    }

    fun String.removeColor(): String {
        return replace("(?i)\\u00A7.", "")
    }

//    fun cleanColour(`in`: String): String? {
//        return `in`.replace("(?i)\\u00A7.".toRegex(), "")
//    }
}