Logo

Programming-Idioms

History of Idiom 38 > diff from v43 to v44

Edit summary for version 44 by programming-idioms.org:
[Elixir] Variable t. Variable s. +DocURL. +DemoURL.

Version 43

2016-11-13, 23:06:48

Version 44

2016-11-30, 21:21:19

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
Code
String.slice(string, i..j-1)
Code
t = String.slice(s, i..j-1)
Doc URL
http://elixir-lang.org/docs/stable/elixir/String.html#slice/2
Demo URL
http://play.elixirbyexample.com/s/8fcff9b61e