Top "Slice" questions

A slice is a representation of a part of a sequence, usually defined by a reference to the underlying sequence, an index giving the starting position, a length or end position, and optionally a "stride" or "step" value.

Python List Slicing with Arbitrary Indices

Is there a better way to extract arbitrary indices from a list in python? The method I currently use is: …

python list slice
How to generate a sequence of numbers

I want to generate a sequence of numbers in Go but I can't find any built-in functions for this. Basically …

arrays go initialization slice
How to slice a string using a delimiter

In Go, if I have a string variable s: var s string = "a,b,c,d,e" How can I …

arrays go slice
golang prepend a string to a slice ...interface{}

I've a method that has as an argument v ...interface{}, I need to prepend this slice with a string. Here …

arrays go slice prepend
Slice a string in groovy

I have a 18 character string I want characters 2-8 from. In python I can do this: sliceMe = "nnYYYYYYnnnnnnnnnn" print sliceMe[2:8] …

java string groovy substring slice
What's the difference between ResponseWriter.Write and io.WriteString?

I've seen three ways of writing content to HTTP response: func Handler(w http.ResponseWriter, req *http.Request) { io.WriteString(…

string http go slice
How to print the memory address of a slice in Golang?

I have some experience in C and I am totally new to golang. func learnArraySlice() { intarr := [5]int{12, 34, 55, 66, 43} slice := intarr[:] fmt.…

go slice memory-address
Readable C# equivalent of Python slice operation

What is the C# equivalent of Python slice operations? my_list = ['a', 'b', 'c', 'd', 'e', 'f', 'g'] result1 = my_…

c# python slice equivalent
Making A Graphic Pie Chart In C#

I'm trying to write a Windows Application that shows a pie chart with seven unequal slices (25%, 20%, 18%, 17%, 10%, 10%, 10%) all of them will …

c# graphics pie-chart slice
Immutable - change elements in array with slice (no splice)

How is possible to change 3/4 elements? Expected output is [1,2,4,3,5] let list = [1,2,3,4,5]; const removeElement = list.indexOf(3); // remove number 3 list.slice(0, removeElement).…

javascript slice immutable.js