Thread zwei Arrays vergleichen und doppelten Inhalt löschen (31 answers)
Opened by Matze2.pl at 2014-11-13 10:27

FIFO
 2014-11-13 10:40
#178316 #178316
User since
2005-06-01
469 Artikel
BenutzerIn

user image
z.B. so:

Code (perl): (dl )
1
2
3
4
my @a = ( 1, 2, 3, 4, 5, 6, 7, 8 );
my @b = ( 12, 13, 1, 2, 3, 4, 22 );
my %h = map { $_ => 1 } @a;
@b = grep { ! exists $h{$_} } @b;
Everyone knows that debugging is twice as hard as writing a program in the first place. So if you're as clever as you can be when you write it, how will you ever debug it? -- Brian Kernighan: "The Elements of Programming Style"

View full thread zwei Arrays vergleichen und doppelten Inhalt löschen