Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: How to remove middle of string?

by atopolc (Pilgrim)
on Jun 06, 2002 at 14:03 UTC ( #172197=note: print w/replies, xml ) Need Help??


in reply to How to remove middle of string?

This was covered fairly well in a node about extracting a range.

this node

Update: changed from an absolute link, thanks broquaint

Replies are listed 'Best First'.
Re: Re: How to remove middle of string?
by Anonymous Monk on Jun 06, 2002 at 14:10 UTC
    Thanks, but I actually am trying to replace the specified text with Different text
      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://172197]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2021-11-27 07:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?