From: Harry Kakueki Date: 2007-05-07T19:20:12+09:00 Subject: Re: separate Chinese and English! with Ruby On 5/7/07, Nanyang Zhan 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 via http://www.ruby-forum.com/.>> Try something like this. t = str.split(//).partition {|x| x=~/[a-z]|[A-Z]/ }p t[0].joinp t[1].join Harry -- http://www.kakueki.com/ruby/list.htmlA Look into Japanese Ruby List in English