mirror of
https://github.com/krgamestudios/Toy.git
synced 2026-04-15 14:54:07 +10:00
22 lines
433 B
Plaintext
22 lines
433 B
Plaintext
//test basic replacement
|
|
var greeting: string = "hello world";
|
|
|
|
greeting[0:4] = "goodnight";
|
|
|
|
assert greeting == "goodnight world", "basic replacement failed";
|
|
|
|
|
|
//test backwards string
|
|
assert greeting[::-1] == "dlrow thgindoog", "backwards string failed";
|
|
|
|
|
|
//test string weird manipulation
|
|
var numbers = "0123456789";
|
|
|
|
numbers[::-2] = "abc";
|
|
|
|
assert numbers == "01234c6b8a", "string weird manipulation failed";
|
|
|
|
|
|
print "All good";
|