From 75a54dfa707ed30518b346c48a40b55a26e84aab Mon Sep 17 00:00:00 2001 From: Jarl Holta Date: Fri, 10 Jan 2025 00:37:07 +0100 Subject: [PATCH] Revert BetweenAll to legacy style --- Source/simba.vartype_string.pas | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Source/simba.vartype_string.pas b/Source/simba.vartype_string.pas index c6f2add8f..07dbb8a2d 100644 --- a/Source/simba.vartype_string.pas +++ b/Source/simba.vartype_string.pas @@ -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;