Sep 27, 2006 #1 davef101 MIS Mar 3, 2006 34 GB i have a string: "16:32:20 19/09/2006" and i want to remove the 19/09/2006 into seperate strings, $day,$mon,$year ... anyone ? Thanks.
i have a string: "16:32:20 19/09/2006" and i want to remove the 19/09/2006 into seperate strings, $day,$mon,$year ... anyone ? Thanks.
Sep 27, 2006 1 #2 ishnid Programmer Aug 29, 2003 1,422 IE Code: my $string = '16:32:20 19/09/2006'; my ( $day, $month, $year ) = ( split /[ \/]/, $string )[2..4]; And if you want the time too: Code: my $string = '16:32:20 19/09/2006'; my ( $hour, $minute, $second, $day, $month, $year ) = split /[ \/:]/, $string; Upvote 0 Downvote
Code: my $string = '16:32:20 19/09/2006'; my ( $day, $month, $year ) = ( split /[ \/]/, $string )[2..4]; And if you want the time too: Code: my $string = '16:32:20 19/09/2006'; my ( $hour, $minute, $second, $day, $month, $year ) = split /[ \/:]/, $string;