diff options
Diffstat (limited to 'src/gleam_stdlib.erl')
-rw-r--r-- | src/gleam_stdlib.erl | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/gleam_stdlib.erl b/src/gleam_stdlib.erl index 1f1f652..9e6a864 100644 --- a/src/gleam_stdlib.erl +++ b/src/gleam_stdlib.erl @@ -6,7 +6,8 @@ atom_create_from_string/1, atom_to_string/1, map_get/2, iodata_append/2, iodata_prepend/2, identity/1, decode_int/1, decode_string/1, decode_bool/1, decode_float/1, decode_thunk/1, decode_atom/1, - decode_list/1, decode_field/2, decode_element/2, parse_int/1, parse_float/1, compare_strings/2]). + decode_list/1, decode_field/2, decode_element/2, parse_int/1, parse_float/1, compare_strings/2, + string_contains/2]). should_equal(Actual, Expected) -> ?assertEqual(Expected, Actual). should_not_equal(Actual, Expected) -> ?assertNotEqual(Expected, Actual). @@ -107,3 +108,11 @@ compare_strings(Lhs, Rhs) -> true -> gt end. + +string_contains(Haystack, Needle) -> + case string:find(Haystack, Needle) of + nomatch -> + false; + _ -> + true + end. |