-
Junior Member
Unsorted array of strings
Question on Unsorted Array? Help?
You have unsorted array of strings, like:
my @arr = qw(hello World Show must go on);
Print this array, sorted in reversed case-insensitive order.
Guys Please help me solve this problem. Appreciate it.
-
Junior Member
Re: Unsorted array of strings
Show some effort man. You will surely get some help.
-
Junior Member
Re: Unsorted array of strings
#!/usr/bin/perl
use strict;
my @array=qw(hello World Show must go on);
my $first_str;
my $second_str;
my @rev_sorted=reverse( sort { lc $second_str cmp lc $first_str } @array) ;
print "\n Rev_Sorted array:@rev_sorted";
exit;
Ans is :
Rev_Sorted arrayn go must Show World hello
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules