I am iterating though a TreeSet and printing it out:
while (it.hasNext()) {
System.out.println(it.next());
}
output:
after
explorers
giant
hoping
internet
into
.
.
.
virtual
world
However, I would like to only print out those strings who's first character is within the range m-z. I have been playing around with java.util.regex, with no success:
String pattern = "[^m-z]";
Do I have the right idea here? Or is there a simpler way of doing this? All I want to do is make sure I only print out those Strings in the TreeSet who's first character is within the range m-z.