Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C# remove elements in list starting with # [duplicate]

Tags:

arrays

c#

Possible Duplicate:
How to remove elements from an array

I have an List with a bunch of data in it. Some of the lines start with a #. I want to remove those lines.

How...?

like image 786
Entity Avatar asked Dec 10 '25 09:12

Entity


1 Answers

assuming its a string List

myList.RemoveAll(x => x.BeginsWith("#"));
like image 160
Akhil Avatar answered Dec 11 '25 22:12

Akhil



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!