mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-02 18:26:27 +13:00
fix comparison to allow match at beginning
This commit is contained in:
parent
59abcded74
commit
3feb331be9
1 changed files with 2 additions and 2 deletions
|
@ -273,8 +273,8 @@ public static IEnumerable<Tuple<string, string>> ForEachBetween(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