On May 7, 2:39 pm, Nanyang Zhan <s... / hotmail.com> wrote:> Don't get me wrong, because I just want to know how to separate English> words from a string with ruby.> There are strings (UTF-8 encoded) to record people's name,> like:>> ຬʦΤ Morgan Freeman> ۻ۰ Bruce Willis>  Lee xiao ming> these strings containing Chinese name(without space between characters),> separated by a space, following an English name>> or> Frank Darabont> Just an English name.>> Would you give me an idea how to separate these Chinese characters(if> any)?>> --> Posted viahttp://www.ruby-forum.com/.
 a = File.open('a.txt') a.each {|x| puts x.split(' ', 2) }Output:ຬʦΤMorgan Freemanۻ۰Bruce WillisLee xiao ming