Given the following example list of strings:
<code>["ABC: {"UserName": "A111", "Something": "aaa"}",
"ABC: {"UserName": "A222", "Something": "bbb"}",
"ABC: {"UserName": "A333", "Something": "ccc"}"]
</code>
<code>["ABC: {"UserName": "A111", "Something": "aaa"}",
"ABC: {"UserName": "A222", "Something": "bbb"}",
"ABC: {"UserName": "A333", "Something": "ccc"}"]
</code>
["ABC: {"UserName": "A111", "Something": "aaa"}",
"ABC: {"UserName": "A222", "Something": "bbb"}",
"ABC: {"UserName": "A333", "Something": "ccc"}"]
I would like to extract a list of substrings identical to all strings in the list (if exist), in series.
So in this example the output would be:
<code>["ABC: {"UserName": "A",
", "Something": "",
""}"]
</code>
<code>["ABC: {"UserName": "A",
", "Something": "",
""}"]
</code>
["ABC: {"UserName": "A",
", "Something": "",
""}"]
The input list of strings could be up to a few thousand, and the length of each could be up to 150K characters.
Special note: substrings must appear in the correct order. So if we had the following string in addition to the above:
<code>"ABC: {"Something": "aaa, ""UserName": "A111"}"
</code>
<code>"ABC: {"Something": "aaa, ""UserName": "A111"}"
</code>
"ABC: {"Something": "aaa, ""UserName": "A111"}"
The result should be substrings that exist in all strings, in order. So:
<code>["ABC: {"]
</code>
<code>["ABC: {"]
</code>
["ABC: {"]