Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
/**
* 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