Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
25
Task/Comma-quibbling/NetRexx/comma-quibbling.netrexx
Normal file
25
Task/Comma-quibbling/NetRexx/comma-quibbling.netrexx
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
/* NetRexx */
|
||||
options replace format comments java crossref symbols nobinary
|
||||
|
||||
runSample(arg)
|
||||
return
|
||||
|
||||
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
method quibble(arg) public static
|
||||
parse arg '[' lst ']'
|
||||
lst = lst.changestr('"', '').space(1)
|
||||
lc = lst.lastpos(',')
|
||||
if lc > 0 then
|
||||
lst = lst.insert('and', lc).overlay(' ', lc)
|
||||
return '{'lst'}'
|
||||
|
||||
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
method runSample(arg) private static
|
||||
lists = ['[]', - -- {}
|
||||
'["ABC"]', - -- {ABC}
|
||||
'["ABC", "DEF"]', - -- {ABC and DEF}
|
||||
'["ABC", "DEF", "G", "H"]'] -- {ABC, DEF, G and H}
|
||||
loop lst over lists
|
||||
say lst.right(30) ':' quibble(lst)
|
||||
end lst
|
||||
return
|
||||
Loading…
Add table
Add a link
Reference in a new issue