in reply to Retain first 4 characters of a string
perlnoobster,
I just added flavors to your dish so that it is eatable and delicious!
$phn = "Apple iPhone 4 Black Cover"; print $trim = join '-', (map { substr($_, 0, 4) } split /\s+/, $phn);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Retain first 4 characters of a string
by perlnoobster (Sexton) on Aug 24, 2012 at 10:08 UTC | |
|
Re^2: Retain first 4 characters of a string
by perlnoobster (Sexton) on Aug 24, 2012 at 12:25 UTC | |
by Anonymous Monk on Aug 24, 2012 at 12:32 UTC | |
by uday_sagar (Scribe) on Aug 24, 2012 at 13:23 UTC | |
by perlnoobster (Sexton) on Aug 24, 2012 at 13:49 UTC | |
by johngg (Canon) on Aug 24, 2012 at 19:00 UTC | |
by Anonymous Monk on Aug 24, 2012 at 14:04 UTC |