Hi there,
I have an M3U file and it's usually formatted likes this:
#EXTM3U
#EXTINF:-1, tvg-name="NAME 1" tvg-logo="LOGO" group-title="TITLE 1",ITEM 1
https:
#EXTINF:-1, tvg-name="NAME 2" tvg-logo="LOGO" group-title="TITLE 2",ITEM 2
https:
#EXTINF:-1, tvg-name="NAME 3" tvg-logo="LOGO" group-title="TITLE 3",ITEM 3
https:
#EXTINF:-1, tvg-name="NAME 4" tvg-logo="LOGO" group-title="TITLE 4",ITEM 4
https:
Number of empty lines mostly are not the same. I'm going to split these Items and remove spaces between them to have an item (without spaces) on each array. What's the best way to do it using String or regex?
What I have tried:
string[] separatingStrings = { "#EXTINF", "..." };
allItems = text.Split(separatingStrings, System.StringSplitOptions.RemoveEmptyEntries);<pre>
I've used this code, but "#EXTINF" is removed from arrays and empty lines are also included.