Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
1
Task/Substring/Ada/substring-1.ada
Normal file
1
Task/Substring/Ada/substring-1.ada
Normal file
|
|
@ -0,0 +1 @@
|
|||
type String is array (Positive range <>) of Character;
|
||||
1
Task/Substring/Ada/substring-2.ada
Normal file
1
Task/Substring/Ada/substring-2.ada
Normal file
|
|
@ -0,0 +1 @@
|
|||
A (<first-index>..<last-index>)
|
||||
14
Task/Substring/Ada/substring-3.ada
Normal file
14
Task/Substring/Ada/substring-3.ada
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
with Ada.Text_IO; use Ada.Text_IO;
|
||||
with Ada.Strings.Fixed; use Ada.Strings.Fixed;
|
||||
|
||||
procedure Test_Slices is
|
||||
Str : constant String := "abcdefgh";
|
||||
N : constant := 2;
|
||||
M : constant := 3;
|
||||
begin
|
||||
Put_Line (Str (Str'First + N - 1..Str'First + N + M - 2));
|
||||
Put_Line (Str (Str'First + N - 1..Str'Last));
|
||||
Put_Line (Str (Str'First..Str'Last - 1));
|
||||
Put_Line (Head (Tail (Str, Str'Last - Index (Str, "d", 1)), M));
|
||||
Put_Line (Head (Tail (Str, Str'Last - Index (Str, "de", 1) - 1), M));
|
||||
end Test_Slices;
|
||||
Loading…
Add table
Add a link
Reference in a new issue