Data update

This commit is contained in:
Ingy döt Net 2026-04-30 12:34:36 -04:00
parent 4bb20c9b71
commit cbaf4c4b64
12390 changed files with 318560 additions and 27248 deletions

View file

@ -0,0 +1,2 @@
Src : String := "Hello";
Dest : String := Src;

View file

@ -0,0 +1,3 @@
Src : String := "Rosetta Stone";
Dest : String := Src(1..7); -- Assigns "Rosetta" to Dest
Dest2 : String := Src(9..13); -- Assigns "Stone" to Dest2

View file

@ -0,0 +1,6 @@
-- 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;

View file

@ -0,0 +1,3 @@
-- 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;

View file

@ -0,0 +1,2 @@
$Src= "Hello"
$dest = $Src

View file

@ -0,0 +1,7 @@
import ballerina/io;
public function main() {
string s = "ballerina";
string t = s;
io:println(`Are s and t equal? ${t == s}`);
}

View file

@ -0,0 +1,2 @@
MOVE "Hello" TO src
MOVE src TO dst

View file

@ -0,0 +1,7 @@
(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

View file

@ -0,0 +1,2 @@
sequence first = "ABC"
sequence newOne = first

View file

@ -0,0 +1,2 @@
let src = "Hello"
let dest = src

View file

@ -0,0 +1,10 @@
HAI 1.3
I HAS A FRANK ITZ "Hello,"
I HAS A PAUL ITZ "World!"
VISIBLE FRANK " " PAUL
FRANK R PAUL
VISIBLE FRANK " " PAUL
KTHXBYE

View file

@ -0,0 +1,2 @@
$str = "foo"
$dup = $str

View file

@ -0,0 +1 @@
$dup = $str.Clone()

View file

@ -0,0 +1,21 @@
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]

View file

@ -0,0 +1,8 @@
str:: "Hello"
;Returns [String: Hello]
str2:: str
;Returns [String: Hello]
str:: "World"
;Returns [String: World]
str2
;Returns [String: Hello]

View file

@ -0,0 +1,2 @@
set src "Rosetta Code"
set dst $src

View file

@ -0,0 +1,28 @@
set A "a string"
set B $A ; # B is a reference to the string
Set C "$A" ; # a new string is created
set D "This is $C" ; # the string bound to C is copied into a new string.
# the append command is internally optimized
# for adding to the end of a string or list
# as is string index for returning a letter
# reverse a string
proc reverse {s} {
set len [string length $s]
set r ""
for { set i $len} { $i >= 0} {incr i -1} {
append r [string index $s $i]
}
return $r
}
set a 12345
set b [reverse $a]
puts stdout "b: $b"

View file

@ -0,0 +1,4 @@
# replace substrings in a string
set rep [string map {"apple" "orange"} "I like apples."]
puts stdout $rep

View file

@ -0,0 +1,2 @@
."hello"
first