String manipulation helpers for javascript