String.split について
irb(main):003:0> "".split(",").length => 0
"hoge".split(",").length == 1
なのだから、"".split(",") で [""] が返ってほしいと思うのは私だけかな。そうなれば常に s.split(",")[0] で文字列が得られるのだが。
Python はそうなる。
Python 2.4.3 (#1, May 18 2006, 07:40:45) [GCC 3.3.3 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> len("".split(",")) 1
VimScript は Ruby と同じ。
:echo len(split("", ",")) 0