This is documentation for Mathematica 5, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)

Documentation / Mathematica / Built-in Functions / Programming / Expression Structure /


FilledSmallSquare expr[[i]] or Part[expr, i] gives the i part of expr.

FilledSmallSquare expr[[-i]] counts from the end.

FilledSmallSquare expr[[0]] gives the head of expr.

FilledSmallSquare expr[[i, j, ... ]] or Part[expr, i, j, ... ] is equivalent to expr[[i]] [[j]] ... .

FilledSmallSquare expr[[ , , ... ]] gives a list of the parts , , ... of expr.

FilledSmallSquare You can make an assignment like t[[i]] = value to modify part of an expression.

FilledSmallSquare When expr is a list, expr[[ , , ... ]] gives a list of parts. In general, the head of expr is applied to the list of parts.

FilledSmallSquare You can get a nested list of parts from expr[[, , ... ]]. Each part has one index from each list.

FilledSmallSquare If any of the are All, all parts at that level are kept.

FilledSmallSquare expr[[All, i]] effectively gives the i column in expr.

FilledSmallSquare Notice that lists are used differently in Part than in functions like Extract, MapAt and Position.

FilledSmallSquare expr[[ Range[i, j] ]] can be used to extract sequences of parts.

FilledSmallSquare If expr is a SparseArray object, expr[[... ]] gives the parts in the corresponding ordinary array.

FilledSmallSquare In StandardForm and InputForm, expr[[spec]] can be input as exprspec.

FilledSmallSquare and can be entered as AliasIndicator[[AliasIndicator and AliasIndicator]]AliasIndicator or \[LeftDoubleBracket] and \[RightDoubleBracket].

FilledSmallSquare In StandardForm, expr[[spec]] can be input as or

FilledSmallSquare See Section 1.2.4, Section 1.2.4, Section 1.4.7, Section 1.8.4, Section 2.1.4 and Section 2.4.2.

FilledSmallSquare See also: First, Head, Last, Extract, Position, ReplacePart, MapAt, Take, PadLeft.

FilledSmallSquare Related package: LinearAlgebra`MatrixManipulation`.

FilledSmallSquare New in Version 1; modified in 5.0.

Further Examples