Question: I want to create a string array between From and To input.
like From = 2000 To = 2003 

I want to create a string[] as below:

> 
> 
> ```
> string[] arrayYear = new string[]{"2000","2001","2002","2003"};
> 
> ```
> 
> 

Is there any easy way of building it dynamically for any range of year?

Please suggest me.

Answer: 
You can use `Enumerable.Range` 

```
int startYear = 2000, endYear = 2004;
string[] arrayYear = Enumerable.Range(startYear, endYear - startYear + 1).Select(i => i.ToString()).ToArray();

```
You can use `Enumerable.Range()`

```
var arrayList = Enumerable.Range(2000, 2015-2000+1).ToList();
string[] arrayYear = arrayList.Select(i => i.ToString()).ToArray();

```