We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d9267e9 commit 0ae3bcdCopy full SHA for 0ae3bcd
src/main/kotlin/com/lambda/config/groups/ReplaceConfig.kt
@@ -35,6 +35,6 @@ interface ReplaceConfig {
35
enum class ReplaceStrategy(val block: (String) -> String) {
36
CensorAll({ it.replaceRange(0..<it.length, "*".repeat(it.length))}),
37
CensorHalf({ it.foldIndexed("") { i, acc, char -> if (i % 2 == 0) acc + char else "$acc*" } }),
38
- KeepFirst({ it.replaceRange(1..<it.length, "*".repeat(it.length-1))}),
+ KeepFirst({ if (it.length <= 1) it else it.replaceRange(1, it.length, "*".repeat(it.length - 1)) }),
39
}
40
0 commit comments