for (int z = 0; z < alParmValues.Count; z++) { asd.Add((alParmValues[z].ToString().Split(',')));// asd is list<string> def.Add(alMethSign[z].ToString().Substring(alMethSign[z].ToString().IndexOf('(') + 1, alMethSign[z].ToString().IndexOf(')') - (alMethSign[z].ToString().IndexOf('(') + 1)).Split(','));// def is list<string> }
These are the errors I get when I compile:
Error 7 The best overloaded method match for 'System.Collections.Generic.List<string>.Add(string)' has some invalid arguments D:\HUTT\Code\HUTT\NUnitClasses\BaseGenerator.cs 1118 18 HUTT Error 8 Argument '1': cannot convert from 'string[]' to 'string' D:\HUTT\Code\HUTT\NUnitClasses\BaseGenerator.cs 1118 27 HUTT
The compiler is telling you, that you cannot use the
List.Add()method that expects astringas input, because you’re handing it the return ofSplit()which returns astring[]. To use astring[]as input, useAddRange().