Skip to content

Commit db4bbeb

Browse files
committed
scalafix
1 parent 044eb09 commit db4bbeb

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

scala-strings/src/main/scala/com/baeldung/scala/strings/capitalize/CapitalizeWords.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ object CapitalizeWords {
1212
.split("\\s+")
1313
.zipWithIndex
1414
.map { (word, index) =>
15-
if (index != 0 && exclusions.contains(word.toLowerCase)) word else word.capitalize
15+
if (index != 0 && exclusions.contains(word.toLowerCase)) word
16+
else word.capitalize
1617
}
1718
.mkString(" ")
1819
}

scala-strings/src/test/scala/com/baeldung/scala/strings/capitalize/CapitalizeWordsUnitTest.scala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ class CapitalizeWordsUnitTest
2828
("This is scala 3", "This is Scala 3"),
2929
("baeldung articles", "Baeldung Articles"),
3030
(" ", ""),
31-
("the quick brown fox jumps over the lazy Dog", "The Quick Brown Fox Jumps Over the Lazy Dog")
31+
(
32+
"the quick brown fox jumps over the lazy Dog",
33+
"The Quick Brown Fox Jumps Over the Lazy Dog"
34+
)
3235
)
3336
it should "capitalize every word of a sentence with exclusion" in {
3437
forAll(tableWithExclusions) { (input, expected) =>

0 commit comments

Comments
 (0)