I have a ListBox
that contains an undetermined value of values and I want to throw those values to a List<>
and from what I researched, I managed to do so far:
var todosValores = lstRoll.Items.OfType<object>().Select(x => x.ToString()).ToList();
List<double> listaDeNums = todosValores.Select(s => double.Parse(s)).ToList();
var lista = new List<double>();
lista.Add(somaLinha1);
lista.Add(Math.Round((somaLinha1 + valorTamanhoIntervalo), 2));
The above code throws the values from ListBox
to List<>
and then plays to another List<>
converting% values to%. It turns out that I now have another double
distinct from those containing decimal numbers.
Assuming my List
now loads the values listaDeNums
and my other list (variable { 1,2,3,...,9,10 }
in the code) load the values lista
.
These two values need to be treated as the beginning and end of a range that will intersect in { 2.86 , 5.65 }
and a variable is incremented to each number that is part of the intersection.
In this particular case exemplified by me above my variable incremented at the end, I should give 3 > and 5.65 in a list of 1 a 10