aboutsummaryrefslogtreecommitdiff
path: root/gen/src/gleam@string.erl
blob: 144d8668416d4ebfd945d329c4bf4d7ae2c5256a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
-module(gleam@string).
-compile(no_auto_import).

-export([length/1, lowercase/1, uppercase/1, reverse/1, split/2, replace/3, append/2]).

length(A) ->
    string:length(A).

lowercase(A) ->
    string:lowercase(A).

uppercase(A) ->
    string:uppercase(A).

reverse(String) ->
    gleam@iodata:to_string(gleam@iodata:reverse(gleam@iodata:new(String))).

split(String, On) ->
    gleam@list:map(gleam@iodata:split(gleam@iodata:new(String), On),
                   fun gleam@iodata:to_string/1).

replace(String, Pattern, With) ->
    gleam@iodata:to_string(gleam@iodata:replace(gleam@iodata:new(String),
                                                Pattern,
                                                With)).

append(S1, S2) ->
    gleam@iodata:to_string(gleam@iodata:append(gleam@iodata:new(S1), S2)).