Comma quibbling: Difference between revisions
Content deleted Content added
Fixed to most recent version |
|||
Line 1,870:
=={{header|Julia}}==
{{works with|Julia|0.6}}
<lang Julia>function quibble(
if isempty(arr) rst = "" else rst = "$(arr[end])" end
if length(arr) > 1 rst = join(
return "{" * rst * "}"
{{Out}}▼
end
<pre>julia> quibble([])▼
@show quibble(["
@show quibble(["ABC", "DEF", "G", "H"])</lang>
▲{{Out}}
▲julia> quibble(["ABC","DEF"])
quibble(["ABC"]) = "{ABC}"
quibble(["ABC", "DEF", "G", "H"]) = "{ABC, DEF, G and H}"</pre>
=={{header|Kotlin}}==
|