Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: How to extract the substring from a delimiter (dot) to end of string?

by httptech (Chaplain)
on May 08, 2000 at 14:41 UTC ( [id://10590]=note: print w/replies, xml ) Need Help??


in reply to How to extract the substring from a delimiter (dot) to end of string?

Here's one way to do it, iterating backwards over the string as an array, then unshifting each char into another array until reaching the dot. Of course, you wouldn't normally want to do it this way in practice.

my @temp; for ( reverse @{[ split( '', $string ) ]} ) { last if /\./; unshift @temp, $_; } $extension = join '', @temp;

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (5)
As of 2024-03-28 12:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found