Here is one way to do it, but not more efficient. Also you can use substr.
$string = "bcde" ; $string = "a$string"; print $string; To add at the end, $string = "abcd" ; $string = "${string}e" ; print $string;
update:As roboticus suggested, unless you tell whether you need effieciency interms of smaller or execution speed or more maintainable, it ll be difficult to suggest correct method. roboticus++ :)
Prasad
In reply to Re: add text to a string
by prasadbabu
in thread add text to a string
by jeanluca
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |