Skip to content

Commit

Permalink
awesome
Browse files Browse the repository at this point in the history
Signed-off-by: J10a1n15 <45315647+j10a1n15@users.noreply.github.com>
  • Loading branch information
j10a1n15 committed Jul 24, 2024
1 parent 35f15df commit ffc3fd0
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -407,11 +407,11 @@ object StringUtils {
}
}

fun String.lastUsedColorCode(startIndex: Int = 0, endIndex: Int = this.length - 1): String? {
fun String.lastUsedColorCode(startIndex: Int = 0, endIndex: Int = this.length): String? {
val colorCodes = "0123456789abcdef"
val regex = Regex("§[${colorCodes}]")

val subString = this.substring(startIndex, endIndex + 1)
val subString = this.substring(startIndex, endIndex)
val matches = regex.findAll(subString)

return matches.lastOrNull()?.value
Expand Down

0 comments on commit ffc3fd0

Please sign in to comment.