Logo

Programming-Idioms

History of Idiom 38 > diff from v54 to v55

Edit summary for version 55 by programming-idioms.org:
New JS implementation by user [programming-idioms.org]

Version 54

2020-01-13, 14:27:42

Version 55

2020-01-13, 14:28:43

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
let t = s.slice(i, j);
Doc URL
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice