From ffc3fd0c34b0e05cd529799a78ceda0f2d4b4870 Mon Sep 17 00:00:00 2001 From: J10a1n15 <45315647+j10a1n15@users.noreply.github.com> Date: Wed, 24 Jul 2024 17:38:22 +0200 Subject: [PATCH] awesome Signed-off-by: J10a1n15 <45315647+j10a1n15@users.noreply.github.com> --- .../me/partlysanestudios/partlysaneskies/utils/StringUtils.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/me/partlysanestudios/partlysaneskies/utils/StringUtils.kt b/src/main/kotlin/me/partlysanestudios/partlysaneskies/utils/StringUtils.kt index 4dac3642..aa8634fc 100644 --- a/src/main/kotlin/me/partlysanestudios/partlysaneskies/utils/StringUtils.kt +++ b/src/main/kotlin/me/partlysanestudios/partlysaneskies/utils/StringUtils.kt @@ -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