mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2025-01-17 21:49:22 +01:00
Merge pull request #947 from microamp/elixir-ranges
[elixir/en] Add ranges under 'Basic types'
This commit is contained in:
commit
4f8b687626
@ -91,6 +91,11 @@ string.
|
|||||||
<<1,2,3>> <> <<4,5>> #=> <<1,2,3,4,5>>
|
<<1,2,3>> <> <<4,5>> #=> <<1,2,3,4,5>>
|
||||||
"hello " <> "world" #=> "hello world"
|
"hello " <> "world" #=> "hello world"
|
||||||
|
|
||||||
|
# Ranges are represented as `start..end` (both inclusive)
|
||||||
|
1..10 #=> 1..10
|
||||||
|
lower..upper = 1..10 # Can use pattern matching on ranges as well
|
||||||
|
[lower, upper] #=> [1, 10]
|
||||||
|
|
||||||
## ---------------------------
|
## ---------------------------
|
||||||
## -- Operators
|
## -- Operators
|
||||||
## ---------------------------
|
## ---------------------------
|
||||||
|
Loading…
x
Reference in New Issue
Block a user