Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > unique elements (case insentitive) of an array in perl

Reply
Thread Tools

unique elements (case insentitive) of an array in perl

 
 
jjl
Guest
Posts: n/a
 
      10-18-2003
I have an array, and try to find out the unique elements (case insentitive)
of array. Could someone help me out. Thanks a lot.


 
Reply With Quote
 
 
 
 
Jürgen Exner
Guest
Posts: n/a
 
      10-18-2003
jjl wrote:
> I have an array, and try to find out the unique elements (case
> insentitive) of array. Could someone help me out. Thanks a lot.


Please see "perldoc -q duplicate":
"How can I remove duplicate elements from a list or array?"

If you want case-insensitive then just define your own normal form, all
lower case of all upper case usually is the easiest.

jue


 
Reply With Quote
 
 
 
 
Andrew Shitov
Guest
Posts: n/a
 
      10-20-2003
> I have an array, and try to find out the unique elements (case insentitive)
> of array. Could someone help me out. Thanks a lot.


Put you elements into hash (using array elemet as a hash key) and before
putting it call uc() or lc(). When it is done, (keys %hash) will be
the desired array.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Making a count of unique elements in an array Dan Kohn Ruby 6 12-28-2013 11:02 AM
list question... unique values in all possible unique spots ToshiBoy Python 6 08-12-2008 05:01 AM
Filter unique elements in an array algorithm ck Java 17 03-09-2007 02:27 AM
How to get non-unique elements from an array? Sam Kong Ruby 64 10-19-2005 03:58 AM
Making array elements Unique George Kinley Perl Misc 6 05-11-2004 10:23 PM



Advertisments