Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: How to remove middle of string?

by atopolc (Pilgrim)
on Jun 06, 2002 at 14:03 UTC ( [id://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?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (5)
As of 2024-04-24 09:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found