This post will discuss how to convert a List of String to a List of Int in C#.

We can use LINQ’s Select() method to convert List<string> to List<int> in C#. The Select() method projects each element of a sequence into a new form. The following code demonstrates its usage:

Download  Run Code

 
Alternatively, you can use the List<T>.ConvertAll() method to convert a list of one type to another type. We can use it to convert a List of String to a List of Int as follows.

Download  Run Code

That’s all about converting a List of String to a List of Int in C#.