# Span i;;j

represents a span of elements i through j.

i;;

represents a span from i to the end.

;;j

represents a span from the beginning to j.

;;

represents a span that includes all elements.

i;;j;;k

represents a span from i through j in steps of k.

i;;;;k

represents a span from i to the end in steps of k.

;;j;;k

represents a span from the beginning to j in steps of k.

;;;;k

represents a span from the beginning to the end in steps of k.

# Details • m[[i;;j;;k]] is equivalent to Take[m,{i,j,k}].
• m[[i;;j]]=v can be used to reset a span of elements in a list or other expression.
• When used in Part, negative i and j count from the end.
• In i;;j, i;;j;;k, etc., i and j can be of the form UpTo[n].
• Any argument of Span[] can be All, in which case it is interpreted as returning the largest possible number of elements consistent with any possible value of that argument.

# Examples

open all close all

## Basic Examples(3)

Take a span of elements from a list:

 In:= Out= Take every third element:

 In:= Out= Assign to a span of elements:

 In:= Out= In:= Out= In:= Out= Assign a sequence of different elements:

 In:= Out= In:= Out= ## Properties & Relations(4)

Introduced in 2007
(6.0)
|
Updated in 2017
(11.2)