comp.lang.ada
 help / color / mirror / Atom feed
From: "Martin Dowie" <martin.dowie@nospam.baesystems.com>
Subject: Re: Natural to String without space? (newbie question)
Date: Thu, 24 May 2001 08:56:27 +0100
Date: 2001-05-24T08:56:27+01:00	[thread overview]
Message-ID: <3b0cbc16$1@pull.gecm.com> (raw)
In-Reply-To: mailman.990658037.12046.comp.lang.ada@ada.eu.org

or,

   function Trim (Value : String;
                  Side  : Ada.Strings.Trim_End := Ada.Strings.Both)
      return String renames Ada.Strings.Fixed.Trim;


Beard, Frank <beardf@spawar.navy.mil> wrote in message
news:mailman.990658037.12046.comp.lang.ada@ada.eu.org...
> Probably the best way is:
>
> Make your own common function, such as:
>
>    with Ada.Strings;        use Ada.Srings;
>    with Ada.Strings.Fixed;  use Ada.Srings.Fixed;
>
>    function Trim(the_String : string) return string is
>    begin
>       return Trim(source => the_String,
>                   side   => both);
>    end Trim;
>
>
> Then include it in a context clause, such as:
>
>    with Ada.Text_Io;
>    with Trim;
>
>    procedure Trim_Test is
>
>       number : natural := 1234;
>
>    begin
>
>       Ada.Text_Io.Put_Line(Trim(natural'image(number)));
>
>    end Trim_Test;
>
>
> Hope this helps.
> Frank
>
> -----Original Message-----
> From: Tomas Hlavaty [mailto:hlavaty@labe.felk.cvut.cz]
> Sent: Wednesday, May 23, 2001 11:18 AM
> To: comp.lang.ada@ada.eu.org
> Subject: Natural to String without space? (newbie question)
>
>
> Natural'Image returns string with space at the begining. Is there any
> standard way how to get number without this additional character?
>
> Thanks,
>
> Tomas
> _______________________________________________
> comp.lang.ada mailing list
> comp.lang.ada@ada.eu.org
> http://ada.eu.org/mailman/listinfo/comp.lang.ada





  reply	other threads:[~2001-05-24  7:56 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-05-23 22:45 Natural to String without space? (newbie question) Beard, Frank
2001-05-24  7:56 ` Martin Dowie [this message]
  -- strict thread matches above, loose matches on Subject: below --
2001-05-24 21:55 Beard, Frank
2001-05-25  7:30 ` Martin Dowie
2001-05-25  8:30   ` Tomas Hlavaty
2001-05-25 15:05   ` Ehud Lamm
2001-05-28  7:31     ` Martin Dowie
2001-05-25 21:23   ` Ole-Hjalmar Kristensen
2001-05-23 15:17 Tomas Hlavaty
2001-05-23 22:37 ` DuckE
2001-05-24  6:33 ` Pascal Obry
2001-05-29 21:04   ` Wes Groleau
2001-05-29 23:00     ` Jeffrey Carter
2001-05-30  7:19     ` Pascal Obry
replies disabled

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