Span(arr, 5, 2);
slice = arr[5:7]
"In both languages, a span(C#) or a slice (Go) represent a similar concept:
- C#: ‘Span is a value type containing a ref and a length‘ , ‘represent contiguous regions of arbitrary memory‘
- Go: ‘Slice is a descriptor for a contiguous segment of an underlying array and provides access to a numbered sequence of elements from that array‘"
Post a Comment