Skip to content

Commit

Permalink
[EAK-527] Enhanced processing of all-caps text
Browse files Browse the repository at this point in the history
  • Loading branch information
smiakchilo committed Jun 4, 2024
1 parent a3cc8ad commit a6787fa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ private static String capitalize(String value) {
return value;
}
String[] words = StringUtils.split(value, " -_");
return Stream.of(words).map(StringUtils::capitalize).collect(Collectors.joining(StringUtils.SPACE));
return Stream.of(words)
.map(StringUtils::lowerCase)
.map(StringUtils::capitalize)
.collect(Collectors.joining(StringUtils.SPACE));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@

public class StringTransformationTest {

private static final String SAMPLE1 = "L0rem Ipsum! Do1or Sit Amet";
private static final String SAMPLE2 = "Lorem Ipsum dolor-sit-Amet";
private static final String SAMPLE3 = "Lorem_Ipsum__dolor_Sit_Amet";
private static final String SAMPLE1 = "L0rem IPSum! Do1or Sit Amet";
private static final String SAMPLE2 = "Lorem IPSum dolor-sit-Amet";
private static final String SAMPLE3 = "Lorem_IPSum__dolor_Sit_Amet";

@Test
public void shouldConvertToLowerCase() {
Expand Down

0 comments on commit a6787fa

Please sign in to comment.