Ruby chop! error

“Dan” falseflyboy@yahoo.comNONO wrote in message

one,two,three,four= lines.slice!(0, 4)

I think you are using slice! when you mean to use split

For example:

lines=“one\ntwo\nthree\n\none1\ntwo2\nthree3\n”
one,two,three,four = lines.slice!(0,4)
p one,two,three,four,lines
#=> “one\n”
#=> nil
#=> nil
#=> nil
#=> “two\nthree\n\none1\ntwo2\nthree3\n”

Is that what you want ?
Please correct me if I misunderstood you.

– shanko