[ create a new paste ] login | about

Link: http://codepad.org/mVkziZmN    [ raw code | output | fork ]

slevy1ster - Perl, pasted on Jan 22:
1
2
3
4
5
6
7
8
9
10
11
use constant EOL_CHAR => "\n";
my $str = '1,2,3\n,4,5,6\n7,8,9';
$str =~ s/,//g;

my @array = split(/\\n/,$str);

$\ = EOL_CHAR; # $\ default null; string printed at end of call to print
foreach(@array) {
  
  print $_;
}


Output:
1
2
3
123
456
789


Create a new paste based on this one


Comments: