From: Farrel Lifson Date: 2007-12-20T00:48:12+09:00 Subject: Re: Split an element in an array into different fields using : On 19/12/2007, Peter Loftus wrote: > Hey guys so i have a example of splitting elements in an array and > getting the third word. Im using spaces to split it. Anyone know how to > split it if i need to use : instead of spaces > > arr = File.readlines("sample.txt") > arr.map! {|line| line.split("\s")[2]} line.split(':') Farrel