Free coupon for initial registration

Join items in the array

Contents [hide]

Output

a,b,c


Code examples


JavaScript

1
2
array = ['a', 'b', 'c'];
console.log(array.join(","));

Perl

1
2
my @array = ("a", "b", "c");
print join(",", @array)."\n";

PHP

1
2
3
<?php
$array = ["a", "b", "c"];
print(implode(",", $array)."\n");

Python

1
2
array = ["a", "b", "c"]
print(",".join(array))

Ruby

1
2
array = ['a', 'b', 'c']
print(array.join(',') + "\n")
Free coupon for initial registration