"Jesús Gabriel y Galán" <jgabrielygalan / gmail.com> wrote in post 961831:
> On Tue, Nov 16, 2010 at 2:57 PM, Bob Theslob <rorcd / yahoo.com> wrote:
>> having them I have had no problems assembling the new string.
>>
>> Can you help with this?
>
> You can use String#split or a regex depending on the requirements:
>
> irb(main):001:0> parts = "Test Part 123 G 477".split(" ")
> => ["Test", "Part", "123", "G", "477"]
> irb(main):002:0> parts[2]
> => "123"
> irb(main):003:0> parts[4]
> => "477"
>
> If you know the data is always separated by spaces and the number is
> in the second and fourth places, this should work.
>
> Jesus.

Jesus,

Thank you, I cannot guarantee that the data will always be in the same ormat, however I know that the length of the string is always the same. an I pase the string one character at a time, and apply a set of rules o determine what data to use and what data to discard?

For example I know that I want to use only the numerical data and not he alphabetic data. The simplest, though not elegant way I can think of s to go one character at a time and determine if that character is a umber or a letter.

Bob