This can be a nice StringUtils function. It is also missing the JSDocs. But lots of functions in this file have the same problem. Could be fixed later.