Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

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

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1000657]
[LanX]: a friend of mine learned French with her African boyfriend ... I have to force my stop grinning when I hear a little blonde who adopted that accent
LanX .oO( *you* don't exist, I'm only messaging to *me* self)
LanX will abandon FF soon

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (7)
As of 2017-03-27 16:30 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (320 votes). Check out past polls.