From: "Peña, Botp" Date: 2007-08-07T10:16:32+09:00 Subject: Re: Determining the common prefix for several strings From: Robert Klemme [mailto:shortcutter@googlemail.com] # I have added some interesting benchmarking: # # $ ./prefix.rb # user system total real # 1000 * list.rx 0.016000 0.000000 0.016000 ( 0.014000) # 1000 * list.rx with conversion 0.031000 0.000000 0.031000 ( 0.030000) # 1 * large.rx 0.000000 0.000000 0.000000 ( 0.000000) # 1 * large.rx with conversion 0.000000 0.000000 0.000000 ( 0.000000) Robert, thanks for the benchmark. I included Brian|Martin's solution in the mix but still the regex scheme is way a lot better w regards to speed. Could some kind soul enlighten me why the regex solution works better, and even best using large strings? kind regards -botp