Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while (it.hasNext()) {
- System.out.println(it.next());
- }
- after
- explorers
- giant
- hoping
- internet
- into
- .
- .
- .
- virtual
- world
- String pattern = "[^m-z]";
- "^[m-z]"
- wordSet.tailSet("m", true);
- wordSet.subSet("b", true, "z", false);
- while (it.hasNext()) {
- String element = it.next();
- if (element.toLowerCase().matches("^[m-z].*")) {
- System.out.println(element);
- }
- }
- while (it.hasNext()) {
- String element = (String) it.next();
- char c = element.charAt(0);
- if (c >= 'm' && c <= 'z') {
- System.out.println(element);
- }
- }
Add Comment
Please, Sign In to add comment