Elixir Examples
Categories
String
String to list of single character strings
Repeat a String a number of times
Multiline Strings / Heredocs
Lowercase all characters in a string
Get the first character in a string
Test if a string ends with another string
Uppercase all characters in a string
String concatenation
String interpolation
Atom to string
Join a list of strings
Strip leading and trailing whitespace from a string
Replace character in a string
Split a string
Parse string to float
Parse string to integer
Reverse a string
Map
Get a value from nested maps
Add a key and value to a map
Get a value from a map
Map to keyword list
Map to struct
Pattern match a map
Map syntax
Size of a map
Update a map value
List
Pattern match a list
Get the last item in a list
Filter list
Concatenate lists
Length of list
List comprehension
Prepend to list
Head of a list
Integer
Integer modulo
Integer division
Math
Raise number to a power (exponent)
Io
Print map
Print list
Print to console
Range
Range of characters
Range syntax
Range to list
Tuple
Tuple syntax
Size of a tuple
Tuple to list
Keyword list
Get a value from a keyword list
Keyword list syntax
Keyword list to map
Kernel
Pipe operator
Alias, Use, Import, and Require
Pin operator
Function capturing
Define a Protocol
With statement
In operator
Get the type of a variable
Return early
Truth table
Nil
Optional parameters
Unless statement
Ternary
Module definition
function definition
Anonymous functions
Cond statement
If statement
case statement
Ecto
Ecto model calculated field
Mix generate Ecto migration
Mix Ecto Rollback Command
Mix Ecto Migrate Command
Regex
Regex basics
Blog post
Phoenix Framework from HTTP Request to Response
Elixir and Ruby Comparison
Sigil
Word list
File
Write a string to file
Read file using File.stream!
Read file into a string
Check if a file exists
Enum
Sum an enumerable
Map an enumerable
Mix
Mix list all tasks command
Kernel
Else if statement (See cond statement)
Switch statement (See case statement)
Boolean operators - and, or, &&, ||
Behaviours
Struct
Get a value from a struct
Update a struct field
View All Examples in Single Page
Recent Examples
Oct 28, 2016
Get a value from nested maps
Aug 25, 2016
Else if statement (See cond statement)
Aug 25, 2016
Switch statement (See case statement)
May 23, 2016
Sum an enumerable
Mar 27, 2016
Get a value from a struct
AltStyle
によって変換されたページ
(->オリジナル)
/
アドレス:
モード:
デフォルト
音声ブラウザ
ルビ付き
配色反転
文字拡大
モバイル