1
1
Fork 0

Renamed `everyFifthNonWhitespace` to `everyFifthNonSpace` to avoid confusion with whitespaces

https://youtrack.jetbrains.com/issue/EDC-421
This commit is contained in:
Svetlana Isakova 2021-07-19 16:10:01 +02:00
parent 50b127aaf1
commit 6c322c815e
4 changed files with 8 additions and 8 deletions

View File

@ -1,7 +1,7 @@
// Summary1/Task6.kt
package summaryIExercise6
fun everyFifthNonWhitespace(s: String) {
fun everyFifthNonSpace(s: String) {
var i = 1
for (c in s) {
if (i % 5 == 0 && c != ' ') {
@ -12,7 +12,7 @@ fun everyFifthNonWhitespace(s: String) {
}
fun main() {
everyFifthNonWhitespace("abc d e fgh ik")
everyFifthNonSpace("abc d e fgh ik")
}
/* Output:
e

View File

@ -3,7 +3,7 @@ files:
- name: src/Task.kt
visible: true
placeholders:
- offset: 91
- offset: 86
length: 109
placeholder_text: TODO()
- name: test/Tests.kt

View File

@ -1,6 +1,6 @@
## Summary 1 (#6)
Implement `everyFifthNonWhitespace()` to display every fifth non-whitespace
character in the given text. For example, `everyFifthNonWhitespace("abc d e fgh
ik")` displays the characters `e` (fifth character if not counting
whitespaces) and `k` (tenth).
Implement `everyFifthNonSpace()` to display every fifth non-space
character in the given text. For example, `everyFifthNonSpace("abc d e fgh
ik")` displays the characters `e` (fifth character if not counting spaces) and
`k` (tenth).

View File

@ -15,7 +15,7 @@ class TestSummaryIExercise6 {
.joinToString("\n")
runAndCheckSystemOutput("Wrong result for 'everyFifthNonWhitespace()'",
expected) {
everyFifthNonWhitespace(s)
everyFifthNonSpace(s)
}
}