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 May 29, 2024, 9:26 a.m.