2020年12月19日星期六

I tried to delete lines more than x characters but i'm getting error

I tried to delete lines more than 35 characters but i'm getting this error: Cannot implicitly convert type 'System.Collections.Generic.IEnumerable<string>' to 'string[]'. An explicit conversion exists (are you missing a cast?) and i don't know how to fix it can anyone help me

My code:

            var lines = File.ReadAllLines("my path");              lines = lines.Where(x => x.Length <= 35); - error is here              File.Delete("my path");              File.AppendAllLines("my path", lines);  
https://stackoverflow.com/questions/65376773/i-tried-to-delete-lines-more-than-x-characters-but-im-getting-error December 20, 2020 at 11:53AM

没有评论:

发表评论