Data update

This commit is contained in:
Ingy döt Net 2026-02-01 16:33:20 -08:00
parent 5150844a7d
commit 4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions

View file

@ -1,11 +0,0 @@
with Ada.Text_IO;
procedure Remove_Characters is
S: String := "upraisers";
use Ada.Text_IO;
begin
Put_Line("Full String: """ & S & """");
Put_Line("Without_First: """ & S(S'First+1 .. S'Last) & """");
Put_Line("Without_Last: """ & S(S'First .. S'Last-1) & """");
Put_Line("Without_Both: """ & S(S'First+1 .. S'Last-1) & """");
end Remove_Characters;

View file

@ -1,33 +0,0 @@
with Ada.Text_IO;
with Ada.Strings.UTF_Encoding.Wide_Strings;
procedure Remove_Characters
is
use Ada.Text_IO;
use Ada.Strings.UTF_Encoding;
use Ada.Strings.UTF_Encoding.Wide_Strings;
S : String := "upraisers";
U : Wide_String := Decode (UTF_8_String'(S));
function To_String (X : Wide_String)return String
is
begin
return String (UTF_8_String'(Encode (X)));
end To_String;
begin
Put_Line
(To_String
("Full String: """ & U & """"));
Put_Line
(To_String
("Without_First: """ & U (U'First + 1 .. U'Last) & """"));
Put_Line
(To_String
("Without_Last: """ & U (U'First .. U'Last - 1) & """"));
Put_Line
(To_String
("Without_Both: """ & U (U'First + 1 .. U'Last - 1) & """"));
end Remove_Characters;

View file

@ -2,7 +2,7 @@ knight: "knight"
socks: "socks"
brooms: "brooms"
print drop knight. ; strip first character
print drop knight ; strip first character
print slice knight 1 (size knight)-1 ; alternate way to strip first character
print chop socks ; strip last character

View file

@ -1,17 +0,0 @@
identification division.
program-id. toptail.
data division.
working-storage section.
01 data-field.
05 value "[this is a test]".
procedure division.
sample-main.
display data-field
*> Using reference modification, which is (start-position:length)
display data-field(2:)
display data-field(1:length of data-field - 1)
display data-field(2:length of data-field - 2)
goback.
end program toptail.

View file

@ -1,10 +1,10 @@
import extensions;
public program()
public Program()
{
var testString := "test";
console.printLine(testString.Substring(1));
console.printLine(testString.Substring(0, testString.Length - 1));
console.printLine(testString.Substring(1, testString.Length - 2))
Console.printLine(testString.Substring(1));
Console.printLine(testString.Substring(0, testString.Length - 1));
Console.printLine(testString.Substring(1, testString.Length - 2))
}

View file

@ -1,4 +0,0 @@
(let ((string "top and tail"))
(substring string 1) ;=> "op and tail"
(substring string 0 (1- (length string))) ;=> "top and tai"
(substring string 1 (1- (length string)))) ;=> "op and tai"

View file

@ -1,15 +0,0 @@
function strip_first(sequence s)
return s[2..$]
end function
function strip_last(sequence s)
return s[1..$-1]
end function
function strip_both(sequence s)
return s[2..$-1]
end function
puts(1, strip_first("knight")) -- strip first character
puts(1, strip_last("write")) -- strip last character
puts(1, strip_both("brooms")) -- strip both first and last characters

View file

@ -1,5 +0,0 @@
$string = "top and tail"
$string
$string.Substring(1)
$string.Substring(0, $string.Length - 1)
$string.Substring(1, $string.Length - 2)

View file

@ -1,5 +0,0 @@
$string = "top and tail"
$string
$string[1..($string.Length - 1)] -join ""
$string[0..($string.Length - 2)] -join ""
$string[1..($string.Length - 2)] -join ""

View file

@ -1,14 +0,0 @@
Function TopNTail(s,mode)
Select Case mode
Case "top"
TopNTail = Mid(s,2,Len(s)-1)
Case "tail"
TopNTail = Mid(s,1,Len(s)-1)
Case "both"
TopNTail = Mid(s,2,Len(s)-2)
End Select
End Function
WScript.Echo "Top: UPRAISERS = " & TopNTail("UPRAISERS","top")
WScript.Echo "Tail: UPRAISERS = " & TopNTail("UPRAISERS","tail")
WScript.Echo "Both: UPRAISERS = " & TopNTail("UPRAISERS","both")