-
-
Save digitalconceptvisuals/1b5544db3c48eb60e52d2dd3a03f33b3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* LowerConverter implements CaseConverter | |
* and converts all words to lower case | |
*/ | |
class LowerConverter implements CaseConverter { | |
@Override | |
public String convert(String... words) { | |
// Accumulate result in StringBuilder | |
StringBuilder result = new StringBuilder(); | |
// All words are converter to lower | |
// And then concatenated | |
for (String word : words) { | |
result.append( | |
word | |
.trim() | |
.toLowerCase()); | |
} | |
return result.toString(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment