boolean function that takes an array. What would be more elegant/efficient way?
in
Programming Questions
•
1 year ago
Finally I managed to split my tweets and display with those "entities" with links and all. :-)
At some point i wrote this:
- boolean areThereBigWords(String[] words)
- {
- int thereIs = 0;
- for (String word:words)
- {
- if (textWidth(word) > lineMax) thereIs++;
- }
- if (thereIs > 0)
- return true;
- else
- return false;
- }
It works, but how would be a better/more elegant way to write a test like this?
1