This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
hernan - it will still print a value if the input is like "abcd <only opening bracket present".... won't it? and worst will be "abcd < efgh <caught here>"
You are right, I could filter it previously, both brakets Must be in string, and in second case, that would include an ugly "<", but anyway would respect definition of "between angle brackets"
thanks for giving a deeper insight
Campbell yes, that is a kind of regex, anyway with regex I meant to Java specific classes, and I would use Matcher, Pattern class, etc.. but I just have the prejudice that (for simple cases like this) they makes the program difficult to read.