Say I have
Str1="/home/root/1.txt.tmp1.test"
Str2="/home/root/2.txt.tmp2.test"
Str3="/home/root/3.txt.tmp3.test"
Is there an off-the-shelf function to get the common string of the strings?
In this case: common_str="/home/root/*.txt.tmp*.test"
Say I have
Str1="/home/root/1.txt.tmp1.test"
Str2="/home/root/2.txt.tmp2.test"
Str3="/home/root/3.txt.tmp3.test"
Is there an off-the-shelf function to get the common string of the strings?
In this case: common_str="/home/root/*.txt.tmp*.test"
To be specific, what I want is "Longest common subsequence" of multiple strings
Actually, that is not the longest common substring at all. It's "/home/root/" - so you probably want to think in terms of a regular expression instead.
Never the less, the problem you did mention has a pretty simple solution that you can write yourself.