Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: extracting substrings

by Eimi Metamorphoumai (Deacon)
on Jan 12, 2005 at 20:45 UTC ( [id://421767]=note: print w/replies, xml ) Need Help??


in reply to extracting substrings

I guess a real question is what do you want to do when they overlap, since you're storing them all into the same array. That said, it seems that you would do a lot better to use substr instead of going through the letters one at a time. Also, instead of using separate $start1, $start2, etc, I'd suggest using an array of start and stop positions.
for $i (0..$#start){ $seq[$i] = substr($sequence, $start[$i], $stop[$i]); }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (7)
As of 2024-04-16 19:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found