Question: I'm trying to take objects out of an object list to an int list. If the object list's value contains a string than I want to convert it to an int. the error that I'm getting is "cannot convert from 'object' to 'System.ReadOnlySpan'. I've tried looking up examples and information about lists made of objects but couldn't find anything. 

I'm also at a loss as to what to do with the 'else' part of the code.

```
public class ListFilterer
{
   public static IEnumerable(int) GetIntegersFromList(List(object) listOfItems)
   {

      List<int> Integers = new List<int>();

      foreach (var value in listOfItems)
      {
        int number = 0;

        bool success = Int32.TryParse(value, out number);

        if (success)
        {
          Integers.Add(number);
        }
        else
        {
          Integers.Add(number);
        }
      }
      return Integers;

   }
}

```

Answer: 
You could simply use:

```
var ints = listOfItems
  .Select(o => { int.TryParse(o.ToString(), out int num); return num;} )
  .ToList();

```

This will work as you wish, as if conversion fails `num` is 0 by default.
If Try Parse fails number is automatically 0 so you can directly write this 

```
 Int32.TryParse(value, out int number)
 Integers.Add(number);

```