get two string common prefix