say "knight".substr(1) # strip first charactersay "socks".substr(0,-1) # strip last charactersay "brooms".substr(1,-1) # strip both first and last characterssay "与今令".substr(1,-1) # => 今
Output:
night
sock
room
今
Strip graphemes:
var gstr ="J\x{332}o\x{332}s\x{332}e\x{301}\x{332}"say gstr-/^\X/# strip first graphemesay gstr-/\X\z/# strip last graphemesay gstr.sub(/^\X/).sub(/\X\z/) # strip both first and last graphemes