longestCommonSuffix: Like longestCommonPrefix(), but on the suffix.

View source: R/fcn_misc.R

longestCommonSuffixR Documentation

Like longestCommonPrefix(), but on the suffix.

Description

Like longestCommonPrefix(), but on the suffix.

Usage

longestCommonSuffix(strings)

Arguments

strings

Vector of strings

Value

Single string - might be empty ("")

Examples


 longestCommonSuffix(c("123.ABC", "45677.ABC", "BC"))  ## "BC"
 longestCommonSuffix(c("123.ABC", "", "BC"))           ## ""
 longestCommonSuffix(c("123.ABC", "45677.ABC"))        ## ".ABC"
 longestCommonSuffix(c("nothing", "in", "common"))     ## ""
 

PTXQC documentation built on Sept. 21, 2022, 9:10 a.m.