I need help understanding why my program is throwing this error:
Cannot convert from 'string' to 'int'
when both list and tVal are strings.
I am getting this error at
List<string> testitems = new List<string>(tVal);
Please advise.
abc is an int array with some random numbers.
static void Main()
{
string tVal = "";
List<int> result = new List<int>();
for (int i = 0; i < abc.Length; i++)
{
if (abc[i] == 7)
{
result.Add(0);
i++;
}
else
{
result.Add(abc[i]);
}
foreach (var item in result)
{
tVal += item.ToString();
}
}
List<string> testitems = new List<string>(tVal);
//more code
}
new List<string>() { tVal };.