--- Merging r47068 into '.':

U    rtl/objpas/sysutils/syshelp.inc
U    rtl/objpas/sysutils/syshelph.inc
--- Recording mergeinfo for merge of r47068 into '.':
 U   .

# revisions: 47068
r47068 | michael | 2020-10-09 13:21:30 +0200 (Fri, 09 Oct 2020) | 1 line
Changed paths:
   M /trunk/rtl/objpas/sysutils/syshelp.inc
   M /trunk/rtl/objpas/sysutils/syshelph.inc

* Patch from Werner Pamler to implement TStringSplitOptions.ExcludeLastEmpty

git-svn-id: branches/fixes_3_2@47099 -
This commit is contained in:
marco 2020-10-12 08:01:59 +00:00
parent 3659780850
commit c2bd150407
2 changed files with 11 additions and 1 deletions

View File

@ -1232,6 +1232,11 @@ begin
Inc(Len);
end;
end;
if (TStringSplitOptions.ExcludeLastEmpty=Options) then
if (Len > 0) and (Result[Len-1] = '') then
dec(Len);
SetLength(Result,Len);
end;
@ -1318,6 +1323,11 @@ begin
Inc(Len);
end;
end;
If (TStringSplitOptions.ExcludeLastEmpty=Options) then
if (Len > 0) and (Result[Len-1] = '') then
dec(Len);
SetLength(Result,Len);
end;

View File

@ -52,7 +52,7 @@ Type
TCompareOptions = system.TCompareOptions;
{$SCOPEDENUMS ON}
TStringSplitOptions = (None, ExcludeEmpty);
TStringSplitOptions = (None, ExcludeEmpty, ExcludeLastEmpty);
{$SCOPEDENUMS OFF}
{ TStringHelper }