RosettaCodeData/Task/Substring-Top-and-tail/Euphoria/substring-top-and-tail.eu
2026-04-30 12:34:36 -04:00

15 lines
385 B
Text

function strip_first(sequence s)
return s[2..$]
end function
function strip_last(sequence s)
return s[1..$-1]
end function
function strip_both(sequence s)
return s[2..$-1]
end function
puts(1, strip_first("knight")) -- strip first character
puts(1, strip_last("write")) -- strip last character
puts(1, strip_both("brooms")) -- strip both first and last characters