This seems to be used a lot, should we make it as a new method in StringUtils?