Created
June 3, 2017 05:52
-
-
Save zr-tex8r/96dc09a6696784d75fb4169d5c9cd8bc to your computer and use it in GitHub Desktop.
Lua: CP932の文字列で ’\’→’/’ の変換を行う
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 文字コードはCP932 | |
function slashify(str) | |
return (tostring(str):gsub("[\x81-\x9f\xe0-\xfc]?.", { ["\\"] = "/" })) | |
end | |
print(slashify([[ふが\ほげ/予定表\アレ/コレ\ソレ]])) | |
-- ふが/ほげ/予定表/アレ/コレ/ソレ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment