common_prefix function

Get common prefix of a string vector