good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
In perl there are rarely recommended ways. Do what makes sense for whatever your exact situation is. The main issue will probably be if you want to change an existing string inplace or make a new string. And your ideas are fine for that.
New string:
Modify old string: The other main point to consider is what you want to happen if the original string is empty. Error ? Warning ? Silence and just give the empty string as result ? All solutions are easily modified for whatever you want there. In reply to Re: howto strip the first char of a string?
by thospel
|
|