From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,8415ea38d87a014 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!newshub.sdsu.edu!elnk-nf2-pas!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!newsread1.news.pas.earthlink.net.POSTED!a6202946!not-for-mail From: Jeffrey Carter Organization: jrcarter commercial-at acm [period | full stop] org User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.7.3) Gecko/20040910 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: span string. References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Date: Sat, 23 Apr 2005 04:10:30 GMT NNTP-Posting-Host: 67.3.218.184 X-Complaints-To: abuse@earthlink.net X-Trace: newsread1.news.pas.earthlink.net 1114229430 67.3.218.184 (Fri, 22 Apr 2005 21:10:30 PDT) NNTP-Posting-Date: Fri, 22 Apr 2005 21:10:30 PDT Xref: g2news1.google.com comp.lang.ada:10644 Date: 2005-04-23T04:10:30+00:00 List-Id: Doker wrote: > I have string like that "abc1020" > haw can i make it a string of fixed lenght of 10 chars like " abc1020"? > "abc" => " abc" "4" => " 4" > "1234567uui" => "1234567uui" subtype String_10 is String (1 .. 10); function To_10 (S : String) return String_10 is -- null; begin -- To_10 if S'Length >= 10 then return S (S'First .. S'First + 9); else return String'(1 .. 10 - S'Length => ' ') & S; end if; end To_10; -- Jeff Carter "Every sperm is sacred." Monty Python's the Meaning of Life 55