Substring/Top and tail: Difference between revisions

Content added Content deleted
(add scala)
Line 345: Line 345:
println("socks" dropRight 1) // strip last character
println("socks" dropRight 1) // strip last character
println("brooms".tail dropRight 1) // strip both first and last characters</lang>
println("brooms".tail dropRight 1) // strip both first and last characters</lang>


=={{header|SNOBOL4}}==
<lang snobol4> "knight" len(1) rem . output ;* strip first character
"socks" rtab(1) . output ;* strip last character
"brooms" len(1) rtab(1) . output ;* strip both first and last characters</lang>


=={{header|Tcl}}==
=={{header|Tcl}}==