Advertisement
Guest User

Untitled

a guest
May 29th, 2015
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. (defn blank? [string]
  2. (every? whitespace? string))
  3.  
  4. (defn whitespace? [character]
  5. (Character/isWhitespace character))
  6.  
  7. clojure
  8. vs
  9. apache commons java implementation
  10.  
  11. public static boolean isWhitespace(CharSequence cs) {
  12. 5371 if (cs == null) {
  13. 5372 return false;
  14. 5373 }
  15. 5374 int sz = cs.length();
  16. 5375 for (int i = 0; i < sz; i++) {
  17. 5376 if (Character.isWhitespace(cs.charAt(i)) == false) {
  18. 5377 return false;
  19. 5378 }
  20. 5379 }
  21. 5380 return true;
  22. 5381 }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement