From f3fadfffe09673cae18d91545ef08b8ebc9d9fa6 Mon Sep 17 00:00:00 2001 From: Basile Burg Date: Sun, 27 Nov 2016 08:51:44 +0100 Subject: [PATCH] add TStrings.strictText --- src/ce_common.pas | 11 +++++++++++ 1 file changed, 11 insertions(+) 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;