在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
local txt1 = " a bcde fg " local txt2 = "a bcde fg " local txt3 = " a bcde fg" txt1 = string.gsub(txt1, "^%s*(.-)%s*$", "%1") txt2 = string.gsub(txt2, "^%s*(.-)%s*$", "%1") txt3 = string.gsub(txt3, "^%s*(.-)%s*$", "%1") print("============") txt1 = "[start]".. txt1 .."[end]" txt2 = "[start]".. txt2 .."[end]" txt3 = "[start]".. txt3 .."[end]" print(txt1) print(txt2) print(txt3) print("==============")
结果如下
|
请发表评论