Hi Frnds,
Found solution.

================
  $len = length($temp);
    if ($len > 2)
    {
     $temp=substr($temp,$len-2,2);
    }
====================

Thanks
Arjun

Deserve before you desire







-----Original Message-----
From: Alfred Vahau [mailto:[EMAIL PROTECTED]
Sent: Friday, January 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 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..
>
>
>
>
>Thanks in advance
>
>Arjun
>
>
>Deserve before you desire
>
>
>
>
>
>
>
>
>
>
>
>
>
>Confidentiality Notice
>
>
>The information contained in this electronic message and any
>attachments to this message are intended for the exclusive use of the
>addressee(s) and may contain confidential or privileged information. If

>you are not the intended recipient, please notify the sender at Wipro
>or [EMAIL PROTECTED] immediately and destroy all copies of this
message and any attachments.
> 
>

--
Perl is my reason for following the Sun;



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





Confidentiality Notice

The information contained in this electronic message and any attachments to 
this message are intended
for the exclusive use of the addressee(s) and may contain confidential or 
privileged information. If
you are not the intended recipient, please notify the sender at Wipro or [EMAIL 
PROTECTED] immediately
and destroy all copies of this message and any attachments.

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