title: How to split the elements ​of an array of strings if they are equal?
body: <p>Good day,</p>
  <p>I currently have a string array like this:</p>
  <pre><code>string[] array = {&quot;aa&quot;,&quot;bb&quot;,&quot;cc&quot;,&quot;dd&quot;,&quot;aa&quot;,&quot;cc&quot;,&quot;ee&quot;,&quot;ff&quot;,&quot;aa&quot;,&quot;bb&quot;}
  </code></pre>
  <p>I would like to be able to get the positions that are the same from the same string [], example:</p>
  <pre><code>string[] a = {&quot;aa&quot;,&quot;aa&quot;,&quot;aa&quot;}
  string[] b = {&quot;bb&quot;,&quot;bb&quot;}
  string[] c = {&quot;cc&quot;,&quot;cc&quot;}
  string[] d = {&quot;dd&quot;}
  string[] e = {&quot;ee&quot;}
  string[] f = {&quot;ff&quot;}
  </code></pre>
  <p>It should be noted that the elements of the parent matrix always change and are not always the same.</p>
  <p>I tried with linq, but I don't get what I'm looking for.</p>
  <p>this was my attempt with linq:</p>
  <pre><code>array.Where(x =&gt; array.Contains(x)).ToArray();
  </code></pre>
  <p>Thanks for help me!</p>