diff options
| author | ruki <[email protected]> | 2019-07-17 13:51:27 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2019-07-17 13:51:27 +0800 |
| commit | e0fbf9ffa3e809bd72afa6182f439db7cd6f4474 (patch) | |
| tree | 732500a47d61a02cf333c3fa043e07ff1eeb989d /xmake/core/base/string.lua | |
| parent | 7138d5770975053ad4fe60f1d8bdd5e4c774fe5b (diff) | |
| parent | 09f10b74034b040a6cb56640cd2c2f1027051b50 (diff) | |
Merge pull request #492 from OpportunityLiu/trim
Custom trim chars
Diffstat (limited to 'xmake/core/base/string.lua')
| -rw-r--r-- | xmake/core/base/string.lua | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/xmake/core/base/string.lua b/xmake/core/base/string.lua index 77cb36e68..b59706a6d 100644 --- a/xmake/core/base/string.lua +++ b/xmake/core/base/string.lua @@ -190,18 +190,18 @@ function string:split(delimiter, opt) end -- trim the spaces -function string:trim() - return self:_trim(0) +function string:trim(trimchars) + return string._trim(self, trimchars, 0) end -- trim the left spaces -function string:ltrim() - return self:_trim(-1) +function string:ltrim(trimchars) + return string._trim(self, trimchars, -1) end -- trim the right spaces -function string:rtrim() - return self:_trim(1) +function string:rtrim(trimchars) + return string._trim(self, trimchars, 1) end -- encode: ' ', '=', '\"', '<' |
