On 5/7/07, Nanyang Zhan <sxain / hotmail.com> wrote:> Akbar Home wrote:> > On May 7, 4:12 pm, akbarhome <akbarh... / gmail.com> wrote:> >> > ۻ۰ Bruce Willis> >>> >> > >> Lee xiao ming> >> > Sorry. Fixed version:> > a.each {|x|> >    if x[0].to_i > 128 then> >      puts x.split(' ', 2)> >    else> >      puts x> >     end> > }> >> > This code is quick and dirty.> Thanks.> But I was wrong. There are more Characters than Chinese and English that> compose the strings. Now I see characters like , , ... if x is one of> these, x[0]> 128 as Chinese does, but I only want to separate Chinese.>> so do you know what exactly range of the value Chinese Characters will> return? or you can tell me where I can find this kind of information.>>>> --> Posted via http://www.ruby-forum.com/.>>
Or this
str.split(//).partition {|x| x.length == 1 }
Harry
-- http://www.kakueki.com/ruby/list.htmlA Look into Japanese Ruby List in English