I have the below line in my code.
My expctation is SkipWhile() will block nulls and will pass only valid values to ForEach(). But nulls are also getting passed to ForEach(). What could be failing in this code?
logChildFolder.SkipWhile(path1 => string.IsNullOrEmpty(path1))
.ToList<string>()
.ForEach(path2 => copyLogFiles(args.SetupInfo.SetupDataFolder, path2));
Use
Wheremethod, i.e.:Suppose in your code values in
logChildFolderare:null,a,b,null.logChildFolder.SkipWhile(path1 => string.IsNullOrEmpty(path1))will returna,b,null.