Current section

Files

Jump to
gleam_stdlib gen src gleam@string.erl
Raw

gen/src/gleam@string.erl

-module(gleam@string).
-compile(no_auto_import).
-export([length/1, lowercase/1, uppercase/1, compare/2, reverse/1, split/2, replace/3, append/2]).
length(A) ->
string:length(A).
lowercase(A) ->
string:lowercase(A).
uppercase(A) ->
string:uppercase(A).
compare(A, B) ->
gleam_stdlib:compare_strings(A, B).
reverse(String) ->
gleam@iodata:to_string(gleam@iodata:reverse(gleam@iodata:new(String))).
split(X, Pattern) ->
gleam@list:map(
gleam@iodata:split(gleam@iodata:new(X), Pattern),
fun gleam@iodata:to_string/1
).
replace(String, Pattern, Substitute) ->
gleam@iodata:to_string(
gleam@iodata:replace(gleam@iodata:new(String), Pattern, Substitute)
).
append(First, Second) ->
gleam@iodata:to_string(
gleam@iodata:append(gleam@iodata:new(First), Second)
).