lcPrefix: Longest common prefix.

lcPrefixR Documentation

Longest common prefix.

Description

lcPrefix returns the longest common prefix of a vector of strings.

Usage

lcPrefix(x, ignore.case = FALSE)

Arguments

x

a vector of character strings

ignore.case

Details

The implementation adapted after https://stackoverflow.com/questions/28273716/r-implementation-for-finding-the-longest-common-starting-substrings-in-a-set-of

Value

The longest common prefix.

Author(s)

Tomas Sieger

References

https://stackoverflow.com/questions/28273716/r-implementation-for-finding-the-longest-common-starting-substrings-in-a-set-of

See Also

lcPostfix,rmLcPrefix

Examples

lcPrefix(c('abcd','abef','aqwe'))

tsieger/tsiMisc documentation built on Oct. 10, 2023, 10:24 p.m.