Fix: Manage most missing names of authors

This commit is contained in:
machiav3lli
2021-10-24 12:16:05 +02:00
parent c4a835bf38
commit 070ec76d0c
2 changed files with 15 additions and 2 deletions

View File

@ -30,6 +30,17 @@ fun String?.trimAfter(char: Char, repeated: Int): String? {
return null
}
fun String?.trimBefore(char: Char, repeated: Int): String? {
var count = 0
this?.let {
for (i in it.indices) {
if (it[i] == char) count++
if (repeated == count) return it.substring(i+1)
}
}
return null
}
fun Char.halfByte(): Int {
return when (this) {
in '0'..'9' -> this - '0'