Logo

Programming-Idioms

History of Idiom 38 > diff from v56 to v57

Edit summary for version 57 by programming-idioms.org:
[Elixir] 404

Version 56

2020-01-13, 14:28:59

Version 57

2020-05-10, 21:58:49

Idiom #38 Extract a substring

Find substring t consisting in characters i (included) to j (excluded) of string s.
(character indexes start at 0 unless specified otherwise)

Illustration

Idiom #38 Extract a substring

Find substring t consisting in characters i (included) to j (excluded) of string s.
(character indexes start at 0 unless specified otherwise)

Illustration
Variables
t,i,j,s
Code
t = String.slice(s, i..j-1)
Code
t = String.slice(s, i..j-1)
Doc URL
http://elixir-lang.org/docs/stable/elixir/String.html#slice/2
Doc URL
https://hexdocs.pm/elixir/String.html#slice/2