sub cis { (join( "\0", @_) =~ m/^([^\0]*)[^\0]*(\0\1[^\0]*)*$/)[0] } Thanks to ChemBoy for pointing an omission and compacting into one statement.
-- stefp
In reply to Re: Find the common initial substring (prefix if you insist)
by stefp
in thread Find the common initial substring (prefix if you insist)
by ChemBoy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |