Advertisement
Guest User

Untitled

a guest
Jul 29th, 2015
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. public boolean checkForEmptiness(String check) {
  2. char[] chars = check.toCharArray();
  3. int spaceCount = 0;
  4. for (char ch : chars) {
  5. if (ch == ' ') {
  6. a++;
  7. }
  8. }
  9. if (a == chars.length) {
  10. return true; // Возвращает true если все знаки это пробел
  11. } else return false;
  12. }
  13.  
  14. string.trim().length() == 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement