slovo/docs/language/examples/supported/owned-string-concat.slo
2026-05-22 08:38:43 +02:00

22 lines
487 B
Plaintext

(module main)
(fn join ((left string) (right string)) -> string
(std.string.concat left right))
(fn greeting () -> string
(std.string.concat "hello, " "slovo"))
(fn greeting_len () -> i32
(std.string.len (greeting)))
(test "owned string concat equality"
(= (greeting) "hello, slovo"))
(test "owned string concat length"
(= (greeting_len) 12))
(fn main () -> i32
(std.io.print_string (join "hello, " "slovo"))
(std.io.print_i32 (std.string.len (join "ab" "cd")))
0)