Data update
This commit is contained in:
parent
5150844a7d
commit
4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions
|
|
@ -1,9 +0,0 @@
|
|||
begin
|
||||
% strings are (fixed length) values in algol W. Assignment makes a copy %
|
||||
string(10) a, copyOfA;
|
||||
a := "some text";
|
||||
copyOfA := a;
|
||||
% assignment to a will not change copyOfA %
|
||||
a := "new value";
|
||||
write( a, copyOfA )
|
||||
end.
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
Src : String := "Hello";
|
||||
Dest : String := Src;
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
Src : String := "Rosetta Stone";
|
||||
Dest : String := Src(1..7); -- Assigns "Rosetta" to Dest
|
||||
Dest2 : String := Src(9..13); -- Assigns "Stone" to Dest2
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
-- Instantiate the generic package Ada.Strings.Bounded.Generic_Bounded_Length with a maximum length of 80 characters
|
||||
package Flexible_String is new Ada.Strings.Bounded.Generic_Bounded_Length(80);
|
||||
use Flexible_String;
|
||||
|
||||
Src : Bounded_String := To_Bounded_String("Hello");
|
||||
Dest : Bounded_String := Src;
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
-- The package Ada.Strings.Unbounded contains the definition of the Unbounded_String type and all its methods
|
||||
Src : Unbounded_String := To_Unbounded_String("Hello");
|
||||
Dest : Unbounded_String := Src;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
a: new "Hello"
|
||||
a: "Hello"
|
||||
b: a ; reference the same string
|
||||
|
||||
; changing one string in-place
|
||||
|
|
|
|||
|
|
@ -1,2 +0,0 @@
|
|||
$Src= "Hello"
|
||||
$dest = $Src
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
MOVE "Hello" TO src
|
||||
MOVE src TO dst
|
||||
|
|
@ -1,3 +1,5 @@
|
|||
a$ = "hello"
|
||||
b$ = a$
|
||||
a$ &= " a"
|
||||
print a$
|
||||
print b$
|
||||
|
|
|
|||
|
|
@ -1,7 +0,0 @@
|
|||
(let* ((str1 "hi")
|
||||
(str1-ref str1)
|
||||
(str2 (copy-sequence str1)))
|
||||
(eq str1 str1-ref) ;=> t
|
||||
(eq str1 str2) ;=> nil
|
||||
(equal str1 str1-ref) ;=> t
|
||||
(equal str1 str2)) ;=> t
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
sequence first = "ABC"
|
||||
sequence newOne = first
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
$str = "foo"
|
||||
$dup = $str
|
||||
|
|
@ -1 +0,0 @@
|
|||
$dup = $str.Clone()
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
REBOL [
|
||||
Title: "String Copy"
|
||||
URL: http://rosettacode.org/wiki/Copy_a_string
|
||||
]
|
||||
|
||||
x: y: "Testing."
|
||||
y/2: #"X"
|
||||
print ["Both variables reference same string:" mold x "," mold y]
|
||||
|
||||
x: "Slackeriffic!"
|
||||
print ["Now reference different strings:" mold x "," mold y]
|
||||
|
||||
y: copy x ; String copy here!
|
||||
y/3: #"X" ; Modify string.
|
||||
print ["x copied to y, then modified:" mold x "," mold y]
|
||||
|
||||
y: copy/part x 7 ; Copy only the first part of y to x.
|
||||
print ["Partial copy:" mold x "," mold y]
|
||||
|
||||
y: copy/part skip x 2 3
|
||||
print ["Partial copy from offset:" mold x "," mold y]
|
||||
|
|
@ -1,2 +1,16 @@
|
|||
src = "this is a string"
|
||||
dst = src
|
||||
-- 8 Nov 2025
|
||||
include Setting
|
||||
|
||||
say 'COPY A STRING'
|
||||
say version
|
||||
say
|
||||
say 'Just assign the string variable to a new one.'
|
||||
a='This is a string.'
|
||||
b=a
|
||||
say a b
|
||||
c="This is also a string."
|
||||
d=c
|
||||
say d c
|
||||
exit
|
||||
|
||||
include Abend
|
||||
|
|
|
|||
|
|
@ -1,2 +0,0 @@
|
|||
set src "Rosetta Code"
|
||||
set dst $src
|
||||
Loading…
Add table
Add a link
Reference in a new issue