in reply to Quicker way to compare these 2 strings?
I don't know if it would be faster, but it's possible since you wouldn't have the overhead associated with splitting the strings into the arrays. Maybe some interpreter monk knows the answer to that.my $matches; for my $i (0..length($first) { if (substr($first,$i,0) eq substr($second,$i,0)) { $matches++; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Quicker way to compare these 2 strings? (Benchmark)
by toolic (Bishop) on May 19, 2010 at 00:29 UTC | |
|
Re^2: Quicker way to compare these 2 strings?
by Anonymous Monk on May 19, 2010 at 00:29 UTC |