undar-lang/test/string.ul

22 lines
329 B
Plaintext
Executable File

str hello = "hello World!";
str msg = " damage inflicted!";
if (msg[1] == 'd') {
print("yes");
}
pln(msg.length as str);
pln(msg);
hello[0] = hello[0] - ' ';
pln(hello);
halt;
function pln(str string) {
nat i = 0;
while (i < string.length) {
write = string[i];
i = i + 1;
}
write = '\n';
}