Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Extract string after removing the substring

by toolic (Bishop)
on Oct 24, 2012 at 15:28 UTC ( #1000657=note: print w/ replies, xml ) Need Help??


in reply to Extract string after removing the substring

Here's one way:

use warnings; use strict; my $string = "ATATTTATATTAT"; my $removed = substr($string, 0, 3); $string = substr($string, 3); print "$string $removed\n"; __END__ TTTATATTAT ATA

UPDATE: Fixed bug. Thanks AnomalousMonk


Comment on Re: Extract string after removing the substring
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (10)
As of 2015-07-29 11:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (263 votes), past polls