[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: String#insert method is destructive... inconsistent?

Yukihiro Matsumoto

12/15/2006 12:09:00 AM

Hi,

In message "Re: String#insert method is destructive... inconsistent?"
on Fri, 15 Dec 2006 07:48:25 +0900, Joe Peterson <joe@lavajoe.com> writes:

|Almost all others (and all that might be ambiguous), like "delete",
|"sub", etc., have both the non-destructive and destructive versions
|("delete", "delete!", etc.).

concat is destructive as well.

matz.

1 Answer

Joe Peterson

12/15/2006 12:43:00 AM

0

Yukihiro Matsumoto wrote:
> Hi,
>
> In message "Re: String#insert method is destructive... inconsistent?"
> on Fri, 15 Dec 2006 07:48:25 +0900, Joe Peterson <joe@lavajoe.com>
> writes:
>
> |Almost all others (and all that might be ambiguous), like "delete",
> |"sub", etc., have both the non-destructive and destructive versions
> |("delete", "delete!", etc.).
>
> concat is destructive as well.
>
> matz.

Thanks, Matz - so cool to get a quick reply! I guess it was the things
like "sub", "gsub", "delete", etc. (all having both forms) that tripped
me up, especially since "insert" seemed like an inverse of "delete".
"concat", since it is like the "<<" operator (as well as "replace", like
the "=" operator), didn't catch my eye in the same way. Is "insert"
fundamentally different than "delete" based on the two rules in the link
provided in the previous post? Ah, I'm probably splitting hairs, being
a perfectionist...!

-LavaJoe

--
Posted via http://www.ruby-....