RosettaCodeData/Task/Substring-Top-and-tail/Lua/substring-top-and-tail.lua

4 lines
210 B
Lua
Raw Permalink Normal View History

2013-04-11 01:07:29 -07:00
print (string.sub("knights",2)) -- remove the first character
print (string.sub("knights",1,-2)) -- remove the last character
print (string.sub("knights",2,-2)) -- remove the first and last characters