This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma 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.