common_prefix function

Longest common prefix of a set of strings.

Longest common prefix of a set of strings.

common_prefix(x)

Arguments

  • x: a character vector.

Returns

A character vector that is the longest common substring at the start of each of the input vectors.