From 377cd50b1e56e32b696b7b1abe11599980aa282f Mon Sep 17 00:00:00 2001 From: ivandrofly Date: Thu, 29 Jan 2015 14:26:04 +0000 Subject: [PATCH] Added StringSplit exMethod --- src/Core/StringExtensions.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Core/StringExtensions.cs b/src/Core/StringExtensions.cs index f70edb942..368f27066 100644 --- a/src/Core/StringExtensions.cs +++ b/src/Core/StringExtensions.cs @@ -35,6 +35,11 @@ namespace Nikse.SubtitleEdit.Core return source.IndexOf(value, comparisonType) >= 0; } + public static string[] SplitToLines(this string source) + { + return source.Replace("\r\n", "\n").Replace("\r", "\n").Split('\n'); + } + // http://www.codeproject.com/Articles/43726/Optimizing-string-operations-in-C public static int FastIndexOf(this string source, string pattern) {