diff --git a/src/ce_common.pas b/src/ce_common.pas index c7a8aea2..0dd66683 100644 --- a/src/ce_common.pas +++ b/src/ce_common.pas @@ -84,6 +84,11 @@ type function normalizePath: string; end; + TStringsHelper = class helper for TStrings + // Same as text but without the additional line terminator. + function strictText: string; + end; + (** * TProcess with assign() 'overriden'. *) @@ -456,6 +461,12 @@ begin exit(TrimFilename(self)); end; +function TStringsHelper.strictText: string; +begin + result := self.Text; + setLength(result, result.length - self.LineBreak.length); +end; + procedure TProcessEx.Assign(value: TPersistent); var src: TProcess;