ios - Remove Empty lines using Regular Expression -


i'm new ios develoment, have data below , want remove empty lines, please let me know pattern applied:

i have used pattern @"(\r\n)" , replaced @"", not work. please me sort out issue

#extinf:-1 tvg-name="seedocs" tvg-logo="rt",rt      http://rt.ashttp14.visionip.tv/live/rt-global-live-hd/playlist.m3u8  #extinf:-1 tvg-name="hsn" tvg-logo="hsn",hsn tv  rtsp://hsn.mpl.miisolutions.net:1935/hsn-live01/_definst_/mp4:420p500kb31  #extinf:-1 tvg-name="us" tvg-logo="us",ustwit  http://bglive-a.bitgravity.com/twit/live/high  #extinf:-1 tvg-name="aljazeera" tvg-logo="aljazeera",aljazeera  rtmp://aljazeeraflashlivefs.fplive.net/aljazeeraflashlive-live/aljazeera_eng_high  #extinf:-1 tvg-name="bbc" tvg-logo="bbc",bbc world news    #extinf:-1 tvg-name="vevo" tvg-logo="vevo",vevo  http://vevoplaylist-live.hls.adaptive.level3.net/vevo/ch1/06/prog_index.m3u8  #extinf:-1 tvg-name="vevo2" tvg-logo="vevo2",vevo 2  http://vevoplaylist-live.hls.adaptive.level3.net/vevo/ch3/06/prog_index.m3u8  #extinf:-1 tvg-name="1hd" tvg-logo="1hd",1hd  rtmp://109.239.142.62/live/livestream3 

search: (?:\r?\n){2,} replace: \r\n

\r?\n both windows , linux compatible. {2,} means "two or more instances"

demo


if supported, can use \r instead of \r?\n include other types of unicode newlines. may useful in future, if not @ present.


Comments

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -