Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public boolean checkForEmptiness(String check) {
- char[] chars = check.toCharArray();
- int spaceCount = 0;
- for (char ch : chars) {
- if (ch == ' ') {
- a++;
- }
- }
- if (a == chars.length) {
- return true; // Возвращает true если все знаки это пробел
- } else return false;
- }
- string.trim().length() == 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement