diff options
| author | ruki <[email protected]> | 2019-06-12 22:33:22 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2019-06-12 09:20:15 +0800 |
| commit | 17332ad1070bb6190bcd24f0a96cca823b4d8d26 (patch) | |
| tree | 532680082206049d3c22d74025052cb705a37c86 /xmake/core/base/string.lua | |
| parent | afac15c89d291e7f5855f4fec4b2ed3ca816b8a4 (diff) | |
improve string.rtrim and cl output
Diffstat (limited to 'xmake/core/base/string.lua')
| -rw-r--r-- | xmake/core/base/string.lua | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/xmake/core/base/string.lua b/xmake/core/base/string.lua index 13ca6c1fb..558344d7f 100644 --- a/xmake/core/base/string.lua +++ b/xmake/core/base/string.lua @@ -200,9 +200,7 @@ end -- trim the right spaces function string:rtrim() - local n = #self - while n > 0 and s:find("^%s", n) do n = n - 1 end - return self:sub(1, n) + return (self:gsub("%s*$", "")) end -- encode: ' ', '=', '\"', '<' |
