Brent Clark wrote:
Hi all

Hello,

Im trying to get the numbers before the hyphen

e.g.
75664545-bookings

Can I use index() for this ?

Yes you could:

$ perl -le'
my $string = "75664545-bookings";
my $pre_hyphen = substr $string, 0, index $string, "-";
print $pre_hyphen;
'
75664545



John
--
use Perl;
program
fulfillment

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to