2006-10-24から1日間の記事一覧

文字列操作の比較表:Ruby, VimScript

Vim 7.2 対応 http://0xcc.net/blog/archives/000137.html だいぶ適当。間違いなどがあったらご指摘いただけると助かります。 Ruby (String) VimScript(string) s = "abc" let s = "abc" s = x + y let s = x . y s == x s ==# x s % [x, y] sprintf(s, x, y…

メモ帳の ,

メモ帳やサクラでの , は論理行でなく、物理行の行頭、行末へ移動のようだ。これが貴公ら Windows のやり方なのかーとすこし感心。

String.split について

irb(main):003:0> "".split(",").length => 0"hoge".split(",").length == 1 なのだから、"".split(",") で [""] が返ってほしいと思うのは私だけかな。そうなれば常に s.split(",")[0] で文字列が得られるのだが。 Python はそうなる。 Python 2.4.3 (#1, M…