Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

How can I delete a part of a string?

by Anonymous Monk
on Feb 06, 2001 at 05:50 UTC ( [id://56582]=perlquestion: print w/replies, xml ) Need Help??

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Replies are listed 'Best First'.
Re: How can I delete a part of a string?
by ariels (Curate) on Feb 15, 2001 at 15:31 UTC
    Expanding on japhy:
    $x = 'Just another COBOL hacker,'; substr($x,13,5) = 'Perl';
    Saying substr($x,13,5,'Perl') would work as well, but I find it less clear.
Re: How can I delete a part of a string?
by I0 (Priest) on Feb 06, 2001 at 12:15 UTC
    What part of the string do you want to delete?
    You might assign "" to a substr, or you might use s///, or perhaps chomp or chop, depending on how you specify the part to be deleted.
Re: How can I delete a part of a string?
by japhy (Canon) on Feb 06, 2001 at 06:23 UTC

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2024-04-18 06:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found