[EMAIL PROTECTED] [am], on Friday, January 7, 2005 at 23:17
(+0530) wrote:
am> Found solution.
am>
am> $len = length($temp);
am> if ($len > 2)
am> {
am> $temp=substr($temp,$len-2,2);
am> }
am>
hm, what about:
$temp = $1 if $temp /(\d\d)$/
[EMAIL PROTECTED] wrote:
Hi Frnds,
Hello,
If I have a number of 6 digits. How to get the last 2 digits. This
should be valid even when i have 2 digits as input.
i.e If input is 991041 then output shud be 41
if input is 41 then output shud be 41
May be junk and simple question but ..i need thi
ary 07, 2005 11:02 PM
To: beginners@perl.org
Subject: Re: Regarding strings
perldoc -f substr
alfred,
[EMAIL PROTECTED] wrote:
>Hi Frnds,
>If I have a number of 6 digits. How to get the last 2 digits. This
>should be valid even when i have 2 digits as input. i.e If input is
>991041 t
perldoc -f substr
alfred,
[EMAIL PROTECTED] wrote:
Hi Frnds,
If I have a number of 6 digits. How to get the last 2 digits. This
should be valid even when i have 2 digits as input.
i.e If input is 991041 then output shud be 41
if input is 41 then output shud be 41
May be junk and simple questio
Hi Frnds,
If I have a number of 6 digits. How to get the last 2 digits. This
should be valid even when i have 2 digits as input.
i.e If input is 991041 then output shud be 41
if input is 41 then output shud be 41
May be junk and simple question but ..i need this ..please do respond..
Than