added strcat builtin

This commit is contained in:
Francesco Cozzuto
2021-12-01 13:19:18 +01:00
parent fba9698b8b
commit 3238c2fb8e
3 changed files with 105 additions and 12 deletions
+22
View File
@@ -0,0 +1,22 @@
A = 'Hello';
B = ', ';
C = 'world';
D = strcat(A, B, C);
fun append_esclamation_mark(A, n)
{
if n == none:
n = 1;
i = 0;
while i < n:
{
A = strcat(A, '!');
i = i + 1;
}
return A;
}
print(append_esclamation_mark(D, 7), '\n');