getindex(::AbstractArray, inds...)

..  getindex(A, inds...)

Returns a subset of array ``A`` as specified by ``inds``, where each ``ind`` may be an ``Int``, a ``Range``, or a ``Vector``. See the manual section on :ref:`array indexing <man-array-indexing>` for details.

Examples

julia> foo = [-3, -2, -1];
julia> getindex(foo, 2);
-2
julia> str = "Hello";
julia> getindex(str, 1);
'H'
julia> getindex(str, 6);
ERROR: BoundsError()

See Also

User Contributed Notes

Add a Note

The format of note supported is markdown, use triple backtick to start and end a code block.

*Required Field
Details

Checking you are not a robot: