Skip to content

Instantly share code, notes, and snippets.

@digitalconceptvisuals
Created July 30, 2020 18:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save digitalconceptvisuals/1b5544db3c48eb60e52d2dd3a03f33b3 to your computer and use it in GitHub Desktop.
Save digitalconceptvisuals/1b5544db3c48eb60e52d2dd3a03f33b3 to your computer and use it in GitHub Desktop.
/**
* 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