Amit Virmani 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 '-')
>
> I have following lines of code:
> :
> :
> $cusip =~ s/\-//g;
> $cusip =~/.${8}$/$1/g;
> :
> :
>
> Is there a shorter way t
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:
$c
Problem:
I have a field $cusip that has to change from ABC123-XX-7 (9 characters with '-') to
ABC123XX (first 8 characters only without '-')
I have following lines of code:
:
:
$cusip =~ s/\-//g;
$cusip =~/.${8}$/$1/g;
:
:
Is there a shorter way to transform this.
- Amit
===