OfType multiple

CSharp · Console

/Program.cs

using System;
using System.Linq;

					
public class Program
{
	public static void Main()
		
		
	{   
		var collection = new object[] { 5, "4545",  'd', 54.5 , 576 };
		
		var result = collection
     .Where(item => new[] { typeof(string), typeof(int) }.Contains(item.GetType()));
		
		Console.WriteLine(string.Join("\n", result));
	}
}
;