I'm a complete amateur trying to teach myself to program. After two days of scouring the Camel and Llama books (nobody tell merlyn), your subroutine was exactly what I wanted. I should have checked the monks first. Thank you for this.
It is amazing to me that this type of function is not built in. I just wanted to thank you for sharing. This simple yet obvious solution is great.
Thanks again and God bless,
-David