mirror of
https://github.com/ShareX/ShareX.git
synced 2024-07-05 06:30:36 +12:00
fix comparison to allow match at beginning
This commit is contained in:
parent
59abcded74
commit
3feb331be9
|
@ -273,8 +273,8 @@ public static string[] Lines(this string text)
|
|||
int f = 0;
|
||||
int b = 0;
|
||||
while (text.Length > f
|
||||
&& 0 < (f = text.IndexOf(front, f))
|
||||
&& 0 < (b = text.IndexOf(back, f + front.Length)))
|
||||
&& 0 <= (f = text.IndexOf(front, f))
|
||||
&& 0 <= (b = text.IndexOf(back, f + front.Length)))
|
||||
{
|
||||
string result = text.Substring(f, (b + back.Length) - f);
|
||||
yield return new Tuple<string, string>(result, result.Substring(front.Length, (result.Length - back.Length) - front.Length));
|
||||
|
|
Loading…
Reference in a new issue