From: ct_oreg@vega.concordia.ca (Chris O'Regan)
Subject: Re: converting lower case to upper case
Date: 1995/04/02
Date: 1995-04-02T00:00:00+00:00 [thread overview]
Message-ID: <3lmihd$msm@newsflash.concordia.ca> (raw)
In-Reply-To: 3llhpu$18v@nyx10.cs.du.edu
In article <3llhpu$18v@nyx10.cs.du.edu>
GS := Greg Schmitt <gschmitt@nyx10.cs.du.edu>
GS>Hi all. I am doing an ada project and I need to convert lower
GS>case character to a upper case character. Is there a simple way
GS>to do this such as:
You can easily create your own To_Upper function like this:
function To_Upper (Cin : Character) return Character is
I : Integer;
Cout : Character;
begin
I := Character'Pos ('a') - Character'Pos ('Z');
if Cin in 'a'..'z' then
Cout := Character'Val (Character'Pos (Cin) - I);
else
Cout := Cin;
end if;
return Cout;
end;
I believe that the character set is standard, so you could redeclare "I"
as:
I : constant Integer := 32;
Chris O'Regan
--
______________________________________________________________________
Chris O'Regan Computer Engineering
ct_orega@ECE.Concordia.CA Concordia University
next prev parent reply other threads:[~1995-04-02 0:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
1995-04-01 0:00 converting lower case to upper case Greg Schmitt
1995-04-02 0:00 ` Chris O'Regan [this message]
-- strict thread matches above, loose matches on Subject: below --
1995-04-04 0:00 tmoran
1995-04-06 0:00 ` Robert Dewar
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox