title: How to extract the substring within the element of an array
body: <p>I am creating a photo and video viewer in which each one has an array with the elements that are going to be inserted and I want to filter its format to store them in a third list</p>
  
  <p>I had a player where one had a array and an intercommunication for photos and videos, then only in the photo section you could only add photos and in the videos you could only add videos, then what I want to do is that in a third array I add either Photo or video and filtering them looking for the extension of the file to add them to their corresponding array.</p>
  
  <p>insert files without a specific order:</p>
  
  <pre><code>string fileList = { "Animals.jpg", "cars.mp4", "planes.mp4", "landscape.jpg", "gameplay.mp4", "freind.mp4", "grildfriend.jpg", "travel.mp4", "school.jpg", "youtube.mp4", "asdada.jpg"};
  </code></pre>
  
  <p>and then it will be like that:</p>
  
  <pre><code>string PhotoList[] = { "Animals.jpg", "landscape.jpg", "grildfriend.jpg", "school.jpg","asdada.jpg" };
  string VideoList[] = { "cars.mp4", "planes.mp4", "gameplay.mp4" "freind.mp4", "travel.mp4", "youtube.mp4" };
  </code></pre>
  
  <p>so far I can only concatenate the two array in a array but this keeps the order of the previous two</p>