Substrings
var word = "etcetera"; var abbr = word.substring(0,3);substring(startPos, endPos)
Replace content
var pinkFloyd = "Goodbye cruel world"; var terryJacks = pinkFloyd.replace('cruel world', 'to you my trusted friend');replace(origSub, newSub); first occurence
var colors = "Grey, lightgrey, darkgrey, slateGrey"; var colours = colors.replace(/grey/gi, "gray");g = global, i = case-insensitive