June 2018 Update
This commit is contained in:
parent
ba8067c3b7
commit
22f33d4004
5278 changed files with 84726 additions and 14379 deletions
|
|
@ -4,4 +4,5 @@ Create another string variable whose value is the original variable concatenated
|
|||
|
||||
To illustrate the operation, show the content of the variables.
|
||||
|
||||
;Tasks featuring Strings:
|
||||
{{Template:Strings}}
|
||||
|
|
|
|||
13
Task/String-concatenation/ABAP/string-concatenation-2.abap
Normal file
13
Task/String-concatenation/ABAP/string-concatenation-2.abap
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
REPORT string_concatenation.
|
||||
|
||||
DATA(var1) = 'Hello'.
|
||||
DATA(var2) = 'Literal'.
|
||||
|
||||
cl_demo_output=>new(
|
||||
)->begin_section( 'String concatenation using |{ }|'
|
||||
)->write( 'Statement: |{ var1 } { var2 }|'
|
||||
)->write( |{ var1 } { var2 }|
|
||||
)->begin_section( 'String concatenation with new string'
|
||||
)->write( 'Statement: |{ var1 } world!|'
|
||||
)->write( |{ var1 } world!|
|
||||
)->display( ).
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
/* created by Aykayayciti Earl Lamont Montgomery
|
||||
April 9th, 2018 */
|
||||
|
||||
s = "critical"
|
||||
> s + " literal"
|
||||
s2 = s + " literal"
|
||||
> s2
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
my $s = 'hello';
|
||||
say $s ~ ' literal';
|
||||
my $s1 = $s ~ ' literal';
|
||||
say $s1;
|
||||
|
||||
# or, using mutating concatenation:
|
||||
|
||||
$s ~= ' literal';
|
||||
say $s;
|
||||
6
Task/String-concatenation/Red/string-concatenation.red
Normal file
6
Task/String-concatenation/Red/string-concatenation.red
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
>>str1: "Hello"
|
||||
>>str2: append str1 " World"
|
||||
>> print str2
|
||||
Hello World
|
||||
>> print str1
|
||||
Hello World
|
||||
14
Task/String-concatenation/Simula/string-concatenation.simula
Normal file
14
Task/String-concatenation/Simula/string-concatenation.simula
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
TEXT PROCEDURE concatenate(head, tail);
|
||||
TEXT head, tail;
|
||||
BEGIN TEXT c;
|
||||
c :- blanks(head.length + tail.length);
|
||||
c.sub(c.start, head.length) := head; ! putText(), anyone?;
|
||||
c.sub(c.start + head.length, tail.length) := tail;
|
||||
concatenate:- c;
|
||||
END;
|
||||
|
||||
TEXT stringVariable, another;
|
||||
stringVariable :- "head ";
|
||||
another :- concatenate(stringVariable, "and tail");
|
||||
OutText("stringVariable: """); OutText(stringVariable);
|
||||
OutText(""", another: "); OutText(another); Outimage;
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
sca a = "foo"
|
||||
sca b = "bar"
|
||||
sca c = a+b
|
||||
di c
|
||||
foobar
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
a = "foo"
|
||||
b = "bar"
|
||||
c = a+b
|
||||
c
|
||||
foobar
|
||||
11
Task/String-concatenation/VBA/string-concatenation.vba
Normal file
11
Task/String-concatenation/VBA/string-concatenation.vba
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
Option Explicit
|
||||
|
||||
Sub String_Concatenation()
|
||||
Dim str1 As String, str2 As String
|
||||
|
||||
str1 = "Rosetta"
|
||||
Debug.Print str1
|
||||
Debug.Print str1 & " code!"
|
||||
str2 = str1 & " code..."
|
||||
Debug.Print str2 & " based on concatenation of : " & str1 & " and code..."
|
||||
End Sub
|
||||
Loading…
Add table
Add a link
Reference in a new issue