largestPrefixLength static method
Finds the length of the largest prefix for two character sequences.
Implementation
static int largestPrefixLength(String first, String second) {
var commonLength = min(first.length, second.length);
for (var i = 0; i < commonLength; i += 1) {
if (first[i] != second[i]) {
return i;
}
}
return commonLength;
}