Logo

Programming-Idioms

History of Idiom 38 > diff from v55 to v56

Edit summary for version 56 by programming-idioms.org:
[JS] Declare result t

Version 55

2020-01-13, 14:28:43

Version 56

2020-01-13, 14:28:59

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