diff options
author | Louis Pilfold <louis@lpil.uk> | 2020-03-05 11:31:55 +0000 |
---|---|---|
committer | Louis Pilfold <louis@lpil.uk> | 2020-03-05 11:31:55 +0000 |
commit | f1c437da38dfec6f4526ed3ca677fb272e24fadc (patch) | |
tree | 099d2d8418275dd3fd4da9329a3d81e2e4580e4d /gen/src | |
parent | f7c3428cd7ca4688aefec567e56913ec950e062e (diff) | |
download | gleam_stdlib-f1c437da38dfec6f4526ed3ca677fb272e24fadc.tar.gz gleam_stdlib-f1c437da38dfec6f4526ed3ca677fb272e24fadc.zip |
string.join
Diffstat (limited to 'gen/src')
-rw-r--r-- | gen/src/gleam@string.erl | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/gen/src/gleam@string.erl b/gen/src/gleam@string.erl index c94fb9f..5d85771 100644 --- a/gen/src/gleam@string.erl +++ b/gen/src/gleam@string.erl @@ -1,7 +1,7 @@ -module(gleam@string). -compile(no_auto_import). --export([length/1, lowercase/1, uppercase/1, compare/2, reverse/1, split/2, replace/3, append/2, concat/1]). +-export([length/1, lowercase/1, uppercase/1, compare/2, reverse/1, split/2, replace/3, append/2, concat/1, join/2]). length(A) -> string:length(A). @@ -36,3 +36,8 @@ append(First, Second) -> concat(Strings) -> gleam@iodata:to_string(gleam@iodata:from_strings(Strings)). + +join(Strings, Separator) -> + gleam@iodata:to_string( + gleam@iodata:from_strings(gleam@list:intersperse(Strings, Separator)) + ). |