dcodeIO de066fc128 Preliminary strings
While not well-wrought, it's at least possible now to log some stuff when debugging
2018-01-27 05:35:14 +01:00

19 lines
433 B
TypeScript

// preliminary
var str: string = "hi, I'm a string";
// exactly once in static memory
assert(changetype<usize>(str) === changetype<usize>("hi, I'm a string"));
assert(str.length == 16);
assert(str.charCodeAt(0) == 0x68);
assert(str.startsWith("hi"));
assert(str.endsWith("string"));
assert(str.includes("I'm"));
assert(str.indexOf(",") == 2);
assert(str.indexOf("x") == -1);
export function getString(): string {
return str;
}