How to identify partial string duplicates in a table
1 ビュー (過去 30 日間)
I have a table of strings - see attached, and I want to be able to programatically identify and extract the identical part of the strings within that table.
For example, in the attached mat. the strings are:
'*EndoPart*' and '*EndoCort*'
Is there a way to identify the identical portion of the string ('Endo') in the entire column and extract it?
回答 (1 件)
Stephen23 2020 年 11 月 28 日
Actually the identical part at the start of the string is '*Endo', and this is easy to find:
>> X = logical(cumprod(all(diff(TableExample.group,1,1)==0,1)));
There is also an identical part at the end of the string 'rt*', but I assume that you only want the identical part at the start.