JavaScript String utility methods