Logo

Programming-Idioms

History of Idiom 38 > diff from v15 to v16

Edit summary for version 16 by :

Version 15

2015-08-22, 19:16:14

Version 16

2015-08-25, 20:24:08

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)

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)

Code
t := copy(s, i + 1, j - i);
Comments bubble
assuming ansistring, so first character is at position 1. This artifact is due to the internal ref-counting payload.