Logo

Programming-Idioms

# 243 Print list
Print the contents of the list or array a on the standard output.
New implementation

Be concise.

Be useful.

All contributions dictatorially edited by webmasters to match personal tastes.

Please do not paste any copyright violating material.

Please try to avoid dependencies to third-party libraries and frameworks.

Other implementations
#include <algorithm>
#include <iostream>
#include <iterator>
std::copy(a.begin(), a.end(), std::ostream_iterator<int>(std::cout, "\n"));
a.ForEach(Console.WriteLine);
Console.WriteLine( string.Join(", ", a) );
print(a);
Enum.each(a, &IO.inspect/1)
write (*,*) a
import "fmt"
fmt.Println(a)
print a
console.log(a);
console.table(a);
import java.util.List;
System.out.println(a);
import java.util.Arrays;
System.out.println(Arrays.toString(a));
print(table.concat(a,", "))
print_r($a)
for el in a do writeln(el);
print "@items\n";
print join(', ', @items) . "\n";
print(a)
puts a.join(", ")
puts a
puts a * ", "
println!("{:?}", a)
(write a)