Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
文字列内の文字を交換する関数を Lua で実行しようとしています。 誰かが私を助けることができますか?
次に例を示します。
Input = "This LIBRARY should work with any string!" Result = "htsil biaryrs ohlu dowkrw ti hna ytsirgn!"
注: スペースもスワップされます
どうもありがとうございます :)
最も単純で明確な解決策は次のとおりです。
Result = Input:gsub("(.)(.)","%2%1")