comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon@pushface.org>
Subject: Re: How to get this space away?
Date: Wed, 03 Jun 2015 20:30:26 +0100
Date: 2015-06-03T20:30:26+01:00	[thread overview]
Message-ID: <lyoakwwpwt.fsf@pushface.org> (raw)
In-Reply-To: 32d031b4-f8ce-4ed5-a066-c5f4a2a1d526@googlegroups.com

Laurent <daemon2@internet.lu> writes:

> On Tuesday, June 2, 2015 at 10:53:30 PM UTC+2, Simon Wright wrote:
>
>> and instead you need to provide something like
>> 
>>    function "+" (R : String) return Bounded_String is
>>    begin
>>       return To_Bounded_String
>>         (Ada.Strings.Fixed.Trim (R, Ada.Strings.Both));
>>    end "+";
>
> Thanks that works. Just don't understand the detour via fixed strings
> and the Ada.Strings.Both

R is a fixed-length string, so the corresponding string operations are
in Ada.Strings.Fixed.

For Ada.Strings.Fixed.Trim see ARM A.4.3(89) [1].

There are also Trims for Bounded and Unbounded strings, which is why
Both is declared in Ada.Strings. I think trimming the fixed string R to
start with may well be the more efficient, but I haven't checked.

[1] http://www.ada-auth.org/standards/12rm/html/RM-A-4-3.html#p89

  reply	other threads:[~2015-06-03 19:30 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-02 20:32 How to get this space away? Laurent
2015-06-02 20:53 ` Simon Wright
2015-06-03 18:59   ` Laurent
2015-06-03 19:30     ` Simon Wright [this message]
2015-06-02 22:28 ` Jeffrey R. Carter
2015-06-03 19:07   ` Laurent
2015-06-03 20:50     ` J-P. Rosen
2015-06-03 23:00       ` Randy Brukardt
2015-06-05  9:26         ` Stephen Davies
2015-06-08 12:33         ` Brad Moore
2015-06-08 19:47           ` Randy Brukardt
2015-06-08 20:25             ` Jeffrey R. Carter
2015-06-09 14:38               ` Brad Moore
2015-06-04  9:37       ` Georg Bauhaus
2015-06-04 12:32         ` Dmitry A. Kazakov
2015-06-05 13:02       ` Laurent
2015-06-06  0:02         ` Dennis Lee Bieber
2015-06-03  7:28 ` Dmitry A. Kazakov
2015-06-03 19:19   ` Laurent
2015-06-08 22:43 ` wowwomenonwheels205
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox