Prev: Rmagick DNG
Next: Sorting numbers.
From: Brian Scott on 12 Feb 2010 20:43 Hello, I am having am issue subtracting two arrays with string elements. I have the following? a = ["StringA", "StringB", "StringC"] b = ["StringC"] How to I subtract the two arrays so I have a new array with the following? result = ["StringA", "StringB"] Thanks -- Posted via http://www.ruby-forum.com/.
From: Gary Wright on 12 Feb 2010 21:05 On Feb 12, 2010, at 8:43 PM, Brian Scott wrote: > How to I subtract the two arrays so I have a new array with the > following? > > result = ["StringA", "StringB"] You've almost answered your own question: >> a = ["StringA", "StringB", "StringC"] => ["StringA", "StringB", "StringC"] >> ?> b = ["StringC"] => ["StringC"] >> a - b => ["StringA", "StringB"] >> Gary Wright
From: Diego Soreira on 13 Feb 2010 12:57 Hi Brian, if you have the following arrays: a = ["StringA", "StringB", "StringC"] b = ["StringC"] should do the following: c = a-b c = ["StringA", "StringB"] Bye. Sorry, about my english Tarzan...jeje... --- El vie 12-feb-10, Brian Scott <mr.novell(a)gmail.com> escribió: De: Brian Scott <mr.novell(a)gmail.com> Asunto: Subtracting string arrays Para: "ruby-talk ML" <ruby-talk(a)ruby-lang.org> Fecha: viernes, 12 de febrero de 2010, 11:43 pm Hello, I am having am issue subtracting two arrays with string elements. I have the following? a = ["StringA", "StringB", "StringC"] b = ["StringC"] How to I subtract the two arrays so I have a new array with the following? result = ["StringA", "StringB"] Thanks -- Posted via http://www.ruby-forum.com/. Yahoo! Cocina Encontra las mejores recetas con Yahoo! Cocina. http://ar.mujer.yahoo.com/cocina/
|
Pages: 1 Prev: Rmagick DNG Next: Sorting numbers. |