string = '\\n' string = "\\n" string = 'Jon \'Maddog\' Orwant' string = "Jon 'Maddog' Orwant" string = "\n" string = '\n' string = "Jon \"Maddog\" Orwant" string = 'Jon "Maddog" Orwant'
value = string.substring offset, count
value = string.substring offset
string = "This is what you have"
first = string.substring 0, 1 start = string.substring 5, 2 rest = string.substring 13 last = string.substring string.length - 1 end = string.substring string.length - 4 piece = string.substring string.length - 8, 16 if string.substring(10).match /pattern/
console.log "Pattern matches in last 10 characters\n"
cut2fmt = (positions) ->
template = ''
lastpos = 1
for place in positions
template += "A" + (place - lastpos) + " "
lastpos = place
template += "A*"
fmt = cut2fmt([8, 14, 20, 26, 30])
console.log fmt