From: ts Date: 2001-08-25T00:11:25+09:00 Subject: [ruby-talk:20292] Re: Performance of Substrings >>>>> "S" == SKa writes: S> def iso_unformat(t) S> if t.size == 8 S> [ t[0,4], t[4,2], t[6,2] ] S> elsif t.size == 14 S> [ t[0,4], t[4,2], t[6,2], t[8,2], t[10,2], t[12,2] ] S> end S> end Have you tried with unpack ? def iso_unformat(t) t.size == 8 ? t.unpack("a4a2a2") : t.unpack("a4a2a2a2a2a2") end Guy Decoux