Substring/Top and tail: Difference between revisions
→{{header|J}}: Add J
(added js, php, python, ruby) |
(→{{header|J}}: Add J) |
||
Line 6:
* String with both the first and last characters removed
=={{header|J}}==
The monadic primitives <code>}.</code> (Behead) and <code>}:</code> (Curtail).
'''Example use:'''<br>
<lang j> }. 'knight' NB. drop first item
night
}: 'socks' NB. drop last item
sock
}:@}. 'brooms' NB. drop first and last items
room</lang>
=={{header|JavaScript}}==
|