Such questions are not enough. But all that I found are looking for either specific pieces in the strings, or simply matching characters. The question is this. There is a List-filled list. In this sheet you need to find the part common to all the lines. BUT! It is necessary to find not all matching characters, but the first matching part. For example:
QWERTY12345 YU QWER TY4564 F QWERGH145 QWER T777 QWE RBT The result of this comparison should be QWE.
I tried this here.
public static string CommonString(string first, string second) { return new string((first.Intersect(second)).ToArray()); } But she, it seems, is looking for all the symbols that are encountered and makes agregate, and therefore does not fit.