in reply to Re: Using the Substr
in thread Using the Substr
and assuming they're not always digits but a colon is always the separator, a combination of split, array slicing, and join:
$result = join( ':', (split( /:/, $string))[0..2]);
-derby
update: I like hdb's better ... less parens.
In Section
Seekers of Perl Wisdom