in reply to Re: Unique character in a string?
in thread Unique character in a string?
This is not true, uniq removes duplicates from an array. From the doc:where @singletons is a list of the elements in @string which occur only once.my @string = qw(a a a a b b b c d e f q q q r r r); my @singletons = uniq(@string);
uniq LIST Returns a new list by stripping duplicate values in LIST. The order of elements in the returned list is the same as in LIST. In scalar context, returns the number of unique elements in LIST. my @x = uniq 1, 1, 2, 2, 3, 5, 3, 4; # returns 1 2 3 5 4
-- Hofmator
|
|---|