Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Deleting everything before a string

by Cybercosis (Monk)
on Dec 21, 2000 at 15:05 UTC ( #47765=note: print w/replies, xml ) Need Help??


in reply to Deleting everything before a string

Okay, this is going to be evil. (note to self: don't program in Perl after learning Standard ML...) but it (might) be somewhat faster, since there's no regex stuff:
my $first_index = index($content, "+_"); my $second_index = index($con +tent, "+_", $first_index); $content = substr($first_index, $first_index - $second_index);
Okay, that wasn't so bad... my Perl instincts almost raged against this, which may not even work:
$content = substr($content, index($content, "+_")+2, index($content, " ++_") - index($content, "+_", index($content, "+_")+1)-4);
*shudder* damn functional languages... =-)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2022-11-28 17:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?