MOO-cows Mailing List Archive

[Prev][Next][Index][Thread]

Re: A peeve.



On Sat, 21 Dec 1996, Brack wrote:
> there is a way to do it, it's just kind of silly/non-intuitive/whatever.
> try blah[2..2]=""

It's not actually silly. If you think of a string in light of how the list
operators work, it makes sense.

{0,1,2}[2..2]={}
makes
{0,2}

{0,1,2}[2]={}
makes
{0,{},2}

In the second example you are replacing one element with another. In a string
each character is an element, so it doesn't make sense.

TTFN
Andy

--
Peace Through Superior Firepower                                  Andrew Wendt
Which word doesn't belong:                               powerpig@arbornet.org
Christianity, Hypocrisy, Lies, Trickery, Sheep                 awendt@magi.com



References:

Home | Subject Index | Thread Index