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.
cleanup.gradle.kts
1 parent e61c047 commit 6cce59cCopy full SHA for 6cce59c
buildSrc/src/main/kotlin/cleanup.gradle.kts
@@ -64,7 +64,13 @@ fun String.sanitized() = replace(
64
*/
65
fun String.sanitizedPreservingCase() = split(regex = Regex("[^A-Za-z0-9]"))
66
.filter { it.isNotEmpty() }
67
- .joinToString("")
+ .joinToString("") { word ->
68
+ when {
69
+ word.all { it.isUpperCase() } -> word
70
+ word.first().isUpperCase() -> word
71
+ else -> word.replaceFirstChar { it.uppercaseChar() }
72
+ }
73
74
75
/**
76
* [File] extension function that replaces all occurrences of `oldValue` with `newValue` in the file.
0 commit comments