解决方法
你可以这样做:
text = "sometext" <-- our string text = text:sub(1,-2) print(text) <-- gives "sometex"
对于❤✱♔“这样我就这样做了
function deleteLastCharacter(str) return(str:gsub("[%z\1-\127\194-\244][\128-\191]*$","")) end for _,str in pairs{"❤✱♔" }do print( deleteLastCharacter(str)) end