String prepend

var str = 'llo!'
str.sub!(/^/, 'He')
say str

or

var str = 'llo!'
str.prepend!('He')
say str

Output:

Hello!

Last updated