Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
11
Task/Substring-Top-and-tail/Ada/substring-top-and-tail-1.ada
Normal file
11
Task/Substring-Top-and-tail/Ada/substring-top-and-tail-1.ada
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
with Ada.Text_IO;
|
||||
|
||||
procedure Remove_Characters is
|
||||
S: String := "upraisers";
|
||||
use Ada.Text_IO;
|
||||
begin
|
||||
Put_Line("Full String: """ & S & """");
|
||||
Put_Line("Without_First: """ & S(S'First+1 .. S'Last) & """");
|
||||
Put_Line("Without_Last: """ & S(S'First .. S'Last-1) & """");
|
||||
Put_Line("Without_Both: """ & S(S'First+1 .. S'Last-1) & """");
|
||||
end Remove_Characters;
|
||||
33
Task/Substring-Top-and-tail/Ada/substring-top-and-tail-2.ada
Normal file
33
Task/Substring-Top-and-tail/Ada/substring-top-and-tail-2.ada
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
with Ada.Text_IO;
|
||||
with Ada.Strings.UTF_Encoding.Wide_Strings;
|
||||
|
||||
procedure Remove_Characters
|
||||
is
|
||||
use Ada.Text_IO;
|
||||
use Ada.Strings.UTF_Encoding;
|
||||
use Ada.Strings.UTF_Encoding.Wide_Strings;
|
||||
|
||||
S : String := "upraisers";
|
||||
U : Wide_String := Decode (UTF_8_String'(S));
|
||||
|
||||
function To_String (X : Wide_String)return String
|
||||
is
|
||||
begin
|
||||
return String (UTF_8_String'(Encode (X)));
|
||||
end To_String;
|
||||
|
||||
begin
|
||||
Put_Line
|
||||
(To_String
|
||||
("Full String: """ & U & """"));
|
||||
Put_Line
|
||||
(To_String
|
||||
("Without_First: """ & U (U'First + 1 .. U'Last) & """"));
|
||||
Put_Line
|
||||
(To_String
|
||||
("Without_Last: """ & U (U'First .. U'Last - 1) & """"));
|
||||
Put_Line
|
||||
(To_String
|
||||
("Without_Both: """ & U (U'First + 1 .. U'Last - 1) & """"));
|
||||
|
||||
end Remove_Characters;
|
||||
Loading…
Add table
Add a link
Reference in a new issue