Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: Re: How to remove middle of string?

by Anonymous Monk
on Jun 06, 2002 at 14:10 UTC ( [id://172204]=note: print w/replies, xml ) Need Help??


in reply to Re: How to remove middle of string?
in thread How to remove middle of string?

Thanks, but I actually am trying to replace the specified text with Different text
  • Comment on Re: Re: How to remove middle of string?

Replies are listed 'Best First'.
Re: Re: Re: How to remove middle of string?
by rob_au (Abbot) on Jun 06, 2002 at 23:39 UTC
    The four-argument usage of perlfunc:substr will do what you are looking for. For example:

    my $string = "foo bar baz"; my $replacement = "moo"; # This will print "foo moo baz" print substr($string, 4, 3, $replacement), "\n";

     

Log In?
Username:
Password:

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

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

    No recent polls found