Prepare for your Next Interview
|
Welcome to the Geeks Talk forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
This is a discussion on Unsorted array of strings within the PERL forums, part of the Web Development category; 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 ...
|
|||||||
| PERL PERL Scripts - Tips, Tricks, Issues, Latest News, PERL Resource and PERL related topics can be discussed in this forum. |
![]() |
| LinkBack | Thread Tools | Display Modes |
|
|||
|
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. |
| Sponsored Links |
|
|||
|
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 array n go must Show World hello
|
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| convert one dimansional array to two dimansional array | Geek_Guest | C and C++ | 6 | 12-22-2007 04:17 AM |
| static array or dynamic array? | rpgubba | C and C++ | 6 | 12-22-2007 04:03 AM |
| character array | pbchaudhari | C and C++ | 2 | 10-27-2007 04:41 AM |
| How DUAL diplays strings of length more than 1 | Geek_Guest | SQL | 2 | 08-10-2007 07:10 AM |
| How to split this entire row's contents into separate strings | JobHelper | SilkTest | 0 | 01-03-2007 05:32 PM |