Path: csiph.com!x330-a1.tempe.blueboxinc.net!feeder1.hal-mli.net!feeder.news-service.com!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!feeder1.enfer-du-nord.net!talisker.lacave.net!lacave.net!not-for-mail From: 7stud -- Newsgroups: comp.lang.ruby Subject: Re: removing nodes from Nokogiri::XML::NodeSet Date: Thu, 14 Apr 2011 12:34:32 -0500 Organization: Service de news de lacave.net Lines: 33 Message-ID: <710026eb14181b797131cfc98b12e535@ruby-forum.com> References: <124883eae0d1e5dcae64297d4872ee9d@ruby-forum.com> NNTP-Posting-Host: bristol.highgroove.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: talisker.lacave.net 1302802499 65396 65.111.164.187 (14 Apr 2011 17:34:59 GMT) X-Complaints-To: abuse@lacave.net NNTP-Posting-Date: Thu, 14 Apr 2011 17:34:59 +0000 (UTC) In-Reply-To: <124883eae0d1e5dcae64297d4872ee9d@ruby-forum.com> X-Received-From: This message has been automatically forwarded from the ruby-talk mailing list by a gateway at comp.lang.ruby. If it is SPAM, it did not originate at comp.lang.ruby. Please report the original sender, and not us. Thanks! For more details about this gateway, please visit: http://blog.grayproductions.net/categories/the_gateway X-Mail-Count: 381546 X-Ml-Name: ruby-talk X-Rubymirror: Yes X-Ruby-Talk: <710026eb14181b797131cfc98b12e535@ruby-forum.com> Xref: x330-a1.tempe.blueboxinc.net comp.lang.ruby:2861 Ted Flethuseo wrote in post #992628: > Hi everyone, > > I am having trouble removing a node from a Nokogiri::XML::NodeSet, not > sure what > I should use to remove a specific node at a given position. > > I have tried the following but it doesn't seem to work: > > puts nodes.length > nodes[0].remove > puts nodes.length > > > Ted Consider this example: str = "hello \n world" arr = str.split " " p arr --output:-- ["hello", "world"] str.delete!(arr[0]) puts str puts arr.length -- Posted via http://www.ruby-forum.com/.