Add two possible solutions to the ascii-printable exercise

This commit is contained in:
Nathan Mattes 2021-09-22 10:49:19 +02:00
parent 29c5e28034
commit ff8cd2798a
1 changed files with 10 additions and 0 deletions

View File

@ -0,0 +1,10 @@
defmodule StringsAndBinaries do
def ascii_printable?(char_list) do
List.ascii_printable?(char_list)
end
def custom_ascii_printable?(char_list) do
# every character in char list must between 20hex 32 and 126
Enum.all?(char_list, &( 32 <= &1 and &1 <= 126))
end
end