Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^3: Splitting on a pattern once

by kiruthika.bkite (Scribe)
on Mar 22, 2010 at 10:58 UTC ( #830062=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Splitting on a pattern once
in thread Splitting on a pattern once

Use the following way to achieve your requirement.

my $str="1:2:3"; my $name=(split(':',$str))[-1];
-1 will return the value of last index.


Comment on Re^3: Splitting on a pattern once
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://830062]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (15)
As of 2015-03-02 20:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When putting a smiley right before a closing parenthesis, do you:









    Results (58 votes), past polls