Question: I have a list that contains numeric values stored in a `List<string>`.

The data may contain some null values.

How can I convert `List<string>` to `List<double?>`?
This is my code:

```
List<double > d2 = d1.ConvertAll(item => double.Parse(item));

```

Answer: 
Try this:

```
var result = yourlist.Select(x=> string.IsNullOrEmpty(x) ? (double?)null : Convert.ToDouble(x)).ToList();

```
```
List<double?> result = myList.Select(n => n == null ? (double?)null : double.Parse(n)).ToList();

```