Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

3
LINES

< > BotCompany Repo | #220 // trim

Lua code

function trim(s)
  return s:match "^%s*(.-)%s*$"
end

Author comment

It's "trim2" from http://lua-users.org/wiki/StringTrim

test run  test run with input  download  show line numbers   

Travelled to 12 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Image recognition results

Recognizer Recognition Result Visualize Recalc
#308 54 [visualize]

Snippet ID: #220
Snippet name: trim
Eternal ID of this version: #220/1
Text MD5: 470885e8fbadea3f395547a320b0bfb4
Author: stefan
Category: standard functions
Type: Lua code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2014-02-01 18:27:25
Source code size: 54 bytes / 3 lines
Pitched / IR pitched: Yes / Yes
Views / Downloads: 775 / 223
Referenced in: [show references]