I wonder if string.compare(0, prefix.size(), prefix) would be easier to read.