Skip to content

Commit

Permalink
Revert BetweenAll to legacy style
Browse files Browse the repository at this point in the history
  • Loading branch information
slackydev committed Jan 9, 2025
1 parent a93401c commit 75a54df
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions Source/simba.vartype_string.pas
Original file line number Diff line number Diff line change
Expand Up @@ -269,16 +269,15 @@ function TSimbaStringHelper.BetweenAll(const S1, S2: String): TStringArray;
var
I: Integer;
begin
Offset := System.Pos(S1, Self, Offset);
I := Self.IndexOf(S1, Offset);
Offset := self.IndexOf(S2, Offset);

if (Offset > 0) then
begin
Offset := Offset + System.Length(S1);
I := System.Pos(S2, Self, Offset);
if (I > 0) then
Result := Result + [System.Copy(Self, Offset, I - Offset)];
Result := Result + [System.Copy(Self, I+Length(S1), Offset-(I+Length(S1)))];
Offset := Offset + System.Length(S2);
end;
end;
end;

var
Offset: Integer;
Expand Down

0 comments on commit 75a54df

Please sign in to comment.