Oregami
Repositories/oxedyne/fe2o3

oxedyne/fe2o3/fe2o3_austenite/tests/fixtures/eval/foundation/string.txt

2.1 KiB, 1 run

created by r1870400018:63846, which is this file's identity for as long as the history lasts, whatever it is later renamed to

download · who wrote it · its history

1// str methods: byte indices, grapheme clusters, patterns and Typst's errors.
2"héllo".len()
3"héllo".first()
4"".first(default: "x")
5"héllo".last()
6"héllo".at(1)
7"héllo".at(-1)
8"héllo".at(10, default: 0)
9"abc".at(0, default: none)
10"héllo".slice(1, 3)
11"héllo".slice(1, count: 2)
12"héllo".slice(-2)
13"héllo".slice(3, 1)
14"abc".slice(0)
15"e\u{301}x".clusters()
16"e\u{301}x".codepoints()
17"🏳️‍🌈a".clusters()
18"ab".clusters().len()
19str.to-unicode("a")
20str.to-unicode("é")
21str.from-unicode(97)
22str.from-unicode(128512)
23"abcabc".contains("ca")
24"abc".contains(regex("b+"))
25"abc".contains("z")
26"abc".starts-with("ab")
27"abc".starts-with(regex("b"))
28"abc".ends-with("bc")
29"abc".ends-with(regex("c$"))
30"abcabc".find("ca")
31"abc".find("z")
32"abc".find(regex("[bc]+"))
33"abcabc".position("ca")
34"abc".position(regex("c"))
35"abc".position("z")
36"a1b22".match(regex("\\d+"))
37"abc".match("b")
38"abc".match("z")
39"a1b22c333".matches(regex("\\d+"))
40"aaa".matches("a")
41"abcb".matches("b")
42"ab".matches(regex(""))
43"a1b2".replace(regex("\\d"), "X")
44"abab".replace("b", "Y", count: 1)
45"abab".replace("b", "Y", count: 0)
46"abc".replace("", "-")
47"abc".replace(regex(""), "-")
48"aXXbX".replace(regex("X*"), "-")
49"héllo".rev()
50"a\u{301}b".rev()
51"a b c".split()
52"a,b,,c".split(",")
53"abc".split("")
54"a1b2c".split(regex("\\d"))
55"aab".split(regex("a*"))
56"a".split("a")
57"".split(",")
58"".split()
59"aXbXc".split("X")
60" \t a b \n".trim()
61"xxaxx".trim("x")
62"xxaxx".trim("x", at: start)
63"xxaxx".trim("x", at: end)
64"xyxya".trim("xy", repeat: false)
65" a".trim(at: end)
66" a ".trim(at: start)
67"1a2".trim(regex("\\d"))
68"abc".trim(regex("z"))
69"aabaa".trim(regex("a"), repeat: false)
70"aabaa".trim(regex("a"), at: end)
71"aabaa".trim(regex("a"), at: start)
72"e\u{301}".normalize()
73"é".normalize(form: "nfd").len()
74"fi".normalize(form: "nfkc")
75"fi".normalize(form: "nfkd")
76"Å".normalize(form: "nfd").codepoints()
77!"".first()
78!"héllo".at(2)
79!"héllo".at(10)
80!"héllo".slice(2)
81!"héllo".slice(1, 10)
82!"ab".slice(0, count: 5)
83!str.to-unicode("ab")
84!str.from-unicode(55296)
85!str.from-unicode(-1)
86!"x".trim(at: center)
87!"ab".first(1)
88!"ab".normalize(form: "x")