What do you want to save?
Add Code snippet
New code examples in category Elixir
-
Alexander Cska 2021-09-30 20:32:04
elixir struct
defmodule UserModule do # UserModule struct definition # Put this inside a module definition defstruct [:first_name, :last_name, :age] # functions to access the struct data, # horever if the struct and functions life in the same module, ... Add solution -
Snagulus 2021-09-26 21:17:04
jason elixir
iex(1)> Jason.encode!(%{"age" => 44, "name" => "Steve Irwin", "nationality" => "Australian"}) "{\"age\":44,\"name\":\"Steve Irwin\",\"nationality\":... Add solution -
Tucker Nelson 2021-09-26 08:39:02
how to split a string in elixir
String.split("ab") Add solution -
AlbeyAmakiir 2021-09-17 00:24:02
elixir read tuples
message = { :ok, "To improve is to change; to be perfect is to change often.", author: "Winston Churchill" } # use the elem function to read values from a tuple status = elem(message, 0) message = elem(message, 1) author = elem(message... Add solution -
-
Tim Wintle 2021-08-27 23:34:02
elixir read csv file
iex> "../test/fixtures/docs/valid.csv" iex> |> Path.expand(__DIR__) iex> |> File.stream! iex> |> CSV.decode iex> |> Enum.take(2) [ok: ["a","b","c"], ok: ["d","e","... Add solution
Best helpers
Tushar Diwan
+5
Pinakin
+5
I-love-php
+5
Sinow
+5
Saforrest
+5
Mastersulm
+5
Adam Clowes
+5
Any Mouse
+5