2016 Update
This commit is contained in:
parent
948b86eafa
commit
dcf5d15da3
7965 changed files with 139854 additions and 31002 deletions
|
|
@ -3,3 +3,5 @@ Create a string variable equal to any text value.
|
|||
Create another string variable whose value is the original variable concatenated with another string literal.
|
||||
|
||||
To illustrate the operation, show the content of the variables.
|
||||
|
||||
{{Template:Strings}}
|
||||
|
|
|
|||
|
|
@ -1,12 +1,9 @@
|
|||
with Ada.Text_IO; use Ada.Text_IO;
|
||||
|
||||
procedure String_Concatenation is
|
||||
S : String := "Hello";
|
||||
S1 : constant String := "Hello";
|
||||
S2 : constant String := S1 & " literal";
|
||||
begin
|
||||
Put_Line (S);
|
||||
declare
|
||||
S1 : String := S & " literal";
|
||||
begin
|
||||
Put_Line (S1);
|
||||
end;
|
||||
Put_Line (S1);
|
||||
Put_Line (S2);
|
||||
end String_Concatenation;
|
||||
|
|
|
|||
3
Task/String-concatenation/Ela/string-concatenation-1.ela
Normal file
3
Task/String-concatenation/Ela/string-concatenation-1.ela
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
hello = "Hello"
|
||||
hello'world = hello ++ ", " ++ "world"
|
||||
(hello, hello'world)
|
||||
1
Task/String-concatenation/Ela/string-concatenation-2.ela
Normal file
1
Task/String-concatenation/Ela/string-concatenation-2.ela
Normal file
|
|
@ -0,0 +1 @@
|
|||
toString $ "Hello" +> ", " +> "world"
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
fun main(args: Array<String>) {
|
||||
val s1 = "James"
|
||||
val s2 = "Bond"
|
||||
println(s1)
|
||||
println(s2)
|
||||
val s3 = s1 + " " + s2
|
||||
println(s3)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue