Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Answer: How do I insert, (not overwrite) into a string?

by Ovid (Cardinal)
on Aug 23, 2000 at 20:10 UTC ( #29246=categorized answer: print w/replies, xml ) Need Help??

Q&A > strings > How do I insert, (not overwrite) into a string? - Answer contributed by Ovid

There are several methods to do this. Shendal has listed one. Here are a couple of others:
# Concatenation my $str = 'ello'; $str = 'H' . $str; # Regex my $str = 'ello'; $str =~ s/^(.*)$/H$1/;
Cheers,
Ovid

Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2016-12-10 17:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (164 votes). Check out past polls.