kl = [a: 1, a: 2, b: 3, c: 0] kl = Keyword.delete_first(kl, :b) kl = Keyword.delete(kl, :a) IO.puts(Keyword.get(kl, :a)) IO.puts(Keyword.get(kl, :b)) IO.puts(Keyword.get(kl, :c))
kl = [a: 1, a: 2, b: 3] kl_new = Keyword.put_new(kl, :c, 5) IO.puts(Keyword.get(kl_new, :c))
list = [a: 1, b: 2] IO.puts(list[:a])
list_1 = [{:a, 1}, {:b, 2}] list_2 = [a: 1, b: 2] IO.puts(list_1 == list_2)
IO.puts(tuple_size({:ok, "hello"}))
IO.puts(length([1, 2, :true, "str"]))
IO.puts(is_list('Hello'))
IO.puts([104, 101, 108, 108, 111])
IO.puts(is_list(to_char_list("hełło"))) IO.puts(is_binary(to_string ('hełło')))
IO.puts('Hello') IO.puts(is_list('Hello'))
We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy. Accept Learn more