aboutsummaryrefslogtreecommitdiff
path: root/gen/src/gleam@string.erl
diff options
context:
space:
mode:
authorErik Terpstra <39518+eterps@users.noreply.github.com>2020-05-15 10:21:25 +0200
committerLouis Pilfold <louis@lpil.uk>2020-05-17 13:26:48 +0100
commit157b535280ba3d579d4ec3aafb0ec45db7272ca3 (patch)
tree556ec949bf6078d39100cdf00d42c5fcf48c89f0 /gen/src/gleam@string.erl
parente6b3c90c83a0eb78fe896377c524d496cfd2cb8e (diff)
downloadgleam_stdlib-157b535280ba3d579d4ec3aafb0ec45db7272ca3.tar.gz
gleam_stdlib-157b535280ba3d579d4ec3aafb0ec45db7272ca3.zip
string.starts_with & string.ends_with
Diffstat (limited to 'gen/src/gleam@string.erl')
-rw-r--r--gen/src/gleam@string.erl8
1 files changed, 7 insertions, 1 deletions
diff --git a/gen/src/gleam@string.erl b/gen/src/gleam@string.erl
index c0557fd..1b914c9 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([is_empty/1, length/1, reverse/1, replace/3, lowercase/1, uppercase/1, compare/2, contains/2, split/2, append/2, concat/1, repeat/2, join/2, trim/1, trim_left/1, trim_right/1]).
+-export([is_empty/1, length/1, reverse/1, replace/3, lowercase/1, uppercase/1, compare/2, contains/2, starts_with/2, ends_with/2, split/2, append/2, concat/1, repeat/2, join/2, trim/1, trim_left/1, trim_right/1]).
is_empty(Str) ->
Str =:= <<""/utf8>>.
@@ -32,6 +32,12 @@ erl_contains(A, B) ->
contains(Haystack, Needle) ->
erl_contains(Haystack, Needle).
+starts_with(A, B) ->
+ gleam_stdlib:string_starts_with(A, B).
+
+ends_with(A, B) ->
+ gleam_stdlib:string_ends_with(A, B).
+
split(X, Substring) ->
gleam@list:map(
gleam@iodata:split(gleam@iodata:new(X), Substring),