title: Re-order array putting nulls at end C#
body: <p>I am trying to make an LRU, and keep track of the value order.</p>
  
  <p>So lets say I have array <code>items = "P1", "P3", null, null</code></p>
  
  <ul>
  <li>P4 shows up (items = <code>"P1", "P3", "P4", null</code>)</li>
  <li>P4 does not already exist, so I just add it to the lowest <code>null</code> index.</li>
  <li>But then P1 comes again, so P1's spot goes to <code>null</code> (items = <code>null, "P3", "P4", null</code>)</li>
  <li>I then need a way (<strong>my question</strong>) to shift everything like so  (items = <code>"P3", "P4", null, null</code>)</li>
  <li>Then add P1 at the lowest <code>null</code> index (items = <code>"P3", "P4", "P1", null</code>)</li>
  <li>And so on, keeping track of LRU</li>
  </ul>
  
  <p>So I need to find a way to move all non-nulls to front of the array (in order). </p>
  
  <p>I did find a post that used this <code>items = items.Where(s =&gt; !String.IsNullOrEmpty(s)).ToArray();</code>, however this removes all <code>null</code>s, when I want to keep intact the array size.</p>
  
  <p>How can I preserve my array size, while shifting all nulls to the end, and all non-nulls to the front (keeping the values in order still)</p>