Show pageOld revisionsBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. # lua gsub {{tag>lua string gsub}} <code lua> function obj:subWord(word) -- 최대 비교 길이를 넘어가는 경우, substring 처리 -- https://stackoverflow.com/questions/15979519/detect-if-last-character-is-not-multibyte-in-lua local wordLen = string.len(word) if wordLen > obj.maxLength then word = string.gsub(word, "^[^\128-\191][\128-\191]*", "") end return word end </code> open/lua-gsub.txt Last modified: 2024/10/05 06:15by 127.0.0.1