Logo

Programming-Idioms

History of Idiom 38 > diff from v31 to v32

Edit summary for version 32 by :
New Go implementation by user [gdey]

Version 31

2016-01-01, 20:07:00

Version 32

2016-01-01, 22:25:05

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 := _s[_i:_j]
Comments bubble
Just need to take a slice of the string.
Doc URL
http://blog.golang.org/slices
Demo URL
http://play.golang.org/p/aboAYhRvtc