xcorp::When it rains, it pours.

"The nice thing about rain," said Eeyore, "is that it always stops. Eventually."

split

ハマって小 1 時間ほど潰した;

#!/usr/bin/ruby --

str = '1 2  3   4     5      '
p str.split(/ /)
[xcorp@f_ck ~]$ ./hoge.rb
["1", "2", "", "3", "", "", "4", "", "", "", "5"]
[xcorp@f_ck ~]$ 
#!/usr/bin/ruby --

str = '1 2  3   4     5      '
p str.split(/\s/)
[xcorp@f_ck ~]$ ./hoge.rb
["1", "2", "", "3", "", "", "4", "", "", "", "5"]
[xcorp@f_ck ~]$ 
#!/usr/bin/ruby --

str = '1 2  3   4     5      '
p str.split(/\s+/)
[xcorp@f_ck ~]$ ./hoge.rb
["1", "2", "3", "4", "5"]
[xcorp@f_ck ~]$ 

なるほどねえ。