From: GianFranco Bozzetti Date: 2010-04-07T03:55:08+09:00 Subject: Re: Parse the data in an array index in ruby "Brk Anl" wrote in message news:15fdfa021d451385f3e8a1637e5f4821@ruby-forum.com... > Hi, > > I have a array in a class. And i want to parse the data in the array's > index. > I tried split method but it said private method 'split'... > > For example > > class AA > > @data... > ........ > end > @data[0]=" ABC HGD KKK 111.." sth like that i need the datas seperately > like ABC > How can i do this? > -- > Posted via http://www.ruby-forum.com/. > Try the folloving snippet: @data = [] @data[0] = "ABC HGD KKK 111" m = @data[0].split(' ') puts m.inspect.to_s # => ["ABC", "HGD", "KKK", "111"] hth gfb