comp.lang.ada
 help / color / mirror / Atom feed
From: "Beard, Frank" <beardf@spawar.navy.mil>
To: "'comp.lang.ada@ada.eu.org'" <comp.lang.ada@ada.eu.org>
Subject: RE: Natural to String without space? (newbie question)
Date: Wed, 23 May 2001 18:45:05 -0400
Date: 2001-05-23T18:45:05-04:00	[thread overview]
Message-ID: <mailman.990658037.12046.comp.lang.ada@ada.eu.org> (raw)

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-23 22:45 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-05-23 22:45 Beard, Frank [this message]
2001-05-24  7:56 ` Natural to String without space? (newbie question) Martin Dowie
  -- 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