File tree 1 file changed +31
-0
lines changed
1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -129,6 +129,23 @@ defmodule FunctionSpecs do
129
129
Keyword .get (keyword_list, atom_key, " " )
130
130
end
131
131
132
+ @spec split_and_lowercase (String .t ()) :: [String .t ()]
133
+ def split_and_lowercase (string) do
134
+ string
135
+ |> String .downcase ()
136
+ |> String .split (" " , trim: true )
137
+ end
138
+
139
+ @spec string_to_int (String .t ()) :: integer ()
140
+ def string_to_int (string) do
141
+ String .to_integer (string)
142
+ end
143
+
144
+ @spec integers_to_strings ([integer ()]) :: [String .t ()]
145
+ def integers_to_strings (integers) do
146
+ Enum .map (integers, fn int -> Integer .to_string (int) end )
147
+ end
148
+
132
149
@spec one_to_two (1 ) :: 2
133
150
def one_to_two (1 ) do
134
151
2
@@ -192,6 +209,20 @@ defmodule FunctionSpecs do
192
209
Keyword .get (keyword_list, atom_key, " " )
193
210
end
194
211
212
+ def split_and_lowercase (string) do
213
+ string
214
+ |> String .downcase ()
215
+ |> String .split (" " , trim: true )
216
+ end
217
+
218
+ def string_to_int (string) do
219
+ String .to_integer (string)
220
+ end
221
+
222
+ def integers_to_strings (integers) do
223
+ Enum .map (integers, fn int -> Integer .to_string (int) end )
224
+ end
225
+
195
226
def one_to_two (1 ) do
196
227
2
197
228
end
You can’t perform that action at this time.
0 commit comments