Warning: file_get_contents(http://localhost:8000/calc?cmd=514&userid=0&debug=1): failed to open stream: Cannot assign requested address in /var/www/tb/show-snippet.php on line 158
String format test (%100s) [514]

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

11
LINES

< > BotCompany Repo | #514 // String format test (%100s)

Lua code - System test

1  
s = ("%99s"):format("hello")
2  
print("|"..s.."|")
3  
assert(#s == 99, #s)
4  
5  
--[[
6  
s = ("%100s"):format("hello")
7  
print("|"..s.."|")
8  
assert(#s == 100)
9  
]]
10  
11  
return true

Author comment

Doesn't work in LuaJ out of the box... hm.

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

Snippet ID: #514
Snippet name: String format test (%100s)
Eternal ID of this version: #514/1
Text MD5: 6de846e58ffd9eb538a9ed659a5b550f
Author: stefan
Category:
Type: Lua code - System test
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2015-03-11 14:44:05
Source code size: 167 bytes / 11 lines
Pitched / IR pitched: No / Yes
Views / Downloads: 1175 / 184
Referenced in: [show references]