What's wrong with commonPrefix(..).length?
Ahh, sorry that works too. I'm surprised :) DMD/Phobos has become really clever at avoiding allocation. Seems there may be need for both commonPrefixCount and commonPrefixLength depending on whether string auto-decoding is needed or not.