Can I do either of these using LINQ:
1. Check that each element in an IEnumerable<string>
has the correct extension. If not, throw exception.
foreach(var filepath in filepaths)
if(Path.GetExtension(filepath) != @".xml")
throw new ArgumentException(...);
2. Take an
IEnumerable<string>
and serialise all of its elements into one string
, with spaces in between each.
string args = "";
foreach (var filepath in filepaths)
args += filepath + " ";
Thanks