I want to choose the media based on the size, but can't seem to figure out how to pick the one with lowest memory consumption in a smart way.
The memory usage is stored in the field Size
.
using System;
using System.Collections.Generic;
struct placeholder
{
string size;
public placeholder(string input)
{
this.size = input;
}
}
public class Program
{
public static void Main()
{
List<placeholder> list = new List<placeholder>();
list.Add(new placeholder("1"));
list.Add(new placeholder("2"));
list.Add(new placeholder("3"));
list.Add(new placeholder("4"));
// How to find the entry in list with lowest placeholder.size?
Console.WriteLine("Hello World");
}
}
But how do I pick the one with with the lowest memory, the size is stored as a string?
I could do it a for loop, but is there something smarter?