FAQ

On Thu, Feb 4, 2016 at 11:45 AM, wrote:
Hi,

Say that I have an array with elements {a,b,c,d,e,f,g,h}. I want to create a
slice containing only elements with, say, index 0, 1, 3 and 6. The
resulting slice would be {a,b,d,g}. Is there a good way to achieve this? I
tried array[0,1,3,6] to no avail...

Jens

--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
http://play.golang.org/p/XrktmqVKlO

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 2 of 3 | next ›
Discussion Overview
groupgolang-nuts @
categoriesgo
postedFeb 4, '16 at 4:11p
activeFeb 4, '16 at 5:22p
posts3
users3
websitegolang.org

People

Translate

site design / logo © 2022 Grokbase