Logo

Programming-Idioms

This language bar is your friend. Select your favorite languages!
Select your favorite languages :
  • Or search :

Idiom #243 Print list

Print the contents of the list or array a on the standard output.

#include <algorithm>
#include <iostream>
#include <iterator>
std::copy(a.begin(), a.end(), std::ostream_iterator<int>(std::cout, "\n"));
Console.WriteLine( string.Join(", ", a) );
a.ForEach(Console.WriteLine);
print(a);
Enum.each(a, &IO.inspect/1)
write (*,*) a
import "fmt"
fmt.Println(a)
print a
console.log(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"; # delimited by spaced
print join(', ', @items) . "\n"; # delimited by what you want
print(a)
puts a.join(", ")
puts a
println!("{:?}", a)
(write a)

New implementation...