From 3d0660559e5cc076c1c5ab438bd5543368cd4583 Mon Sep 17 00:00:00 2001 From: James Shubin Date: Mon, 9 Sep 2024 14:54:45 -0400 Subject: [PATCH] examples: lang: Add a join example Good reminder that a lot of the golang stdlib functions are available. --- examples/lang/join.mcl | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 examples/lang/join.mcl diff --git a/examples/lang/join.mcl b/examples/lang/join.mcl new file mode 100644 index 00000000..3bff3990 --- /dev/null +++ b/examples/lang/join.mcl @@ -0,0 +1,9 @@ +import "fmt" +import "golang/strings" + +$l = ["a", "b", "c",] +$joined = strings.join($l, ", ") + +print "debug" { + msg => "${joined}", +}