Created
November 14, 2019 03:28
-
-
Save kstmasa/c6088316f14611c272584c2d99eb62e9 to your computer and use it in GitHub Desktop.
Split WEBVTT with string input.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Split WEBVTT with string input. | |
/// </summary> | |
/// <param name="input"></param> | |
/// <param name="linefeed"></param> | |
/// <returns> content </returns> | |
public static string SplitWEBVTT(string input ,bool linefeed){ | |
string content = ""; | |
string linefeedtext = linefeed? "\r\n\r\n" : "\r\n"; | |
foreach(var myString in input.Split("\r\n".ToCharArray(),StringSplitOptions.RemoveEmptyEntries)){ | |
if(myString.Contains("-->")){ | |
continue; | |
} | |
content+= myString + linefeedtext; | |
} | |
return content; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment