Virmani, Amit (GMI Debt Technology) wrote:
> Problem:
> I have a field $cusip that has to change from ABC123-XX-7 (9
> characters with '-') to ABC123XX (first 8 characters only without
> '-')  
        If the field is truly a constant as you state, then two substr would be just 
as good:
        $cusip = substr($cusip,0,6) . substr($cusip,7,2);
Wags ;)
> 
> I have following lines of code:
>> 
>> 
> $cusip =~ s/\-//g;
> $cusip =~/.${8}$/$1/g;
>> 
>> 
> 
> Is there a shorter way to transform this.
> - Amit


*******************************************************
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.
*******************************************************


--
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