Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Array slicing
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Computer programming operation}} {{About|the data structure operation|other uses of slicing|Slicing (disambiguation)}} In [[computer programming]], '''array slicing''' is an operation that extracts a subset of elements from an [[Array data type|array]] and packages them as another array, possibly in a different [[dimension]] from the original. Common examples of array slicing are extracting a substring from a [[string (computer science)|string]] of characters, the "''ell''" in "h''ell''o", extracting a row or column from a two-dimensional array, or extracting a [[vector (mathematics)|vector]] from a [[matrix (mathematics)|matrix]]. Depending on the [[programming language]], an array slice can be made out of non-consecutive elements. Also depending on the language, the elements of the new array may be [[aliasing (computing)|aliased to]] (i.e., share memory with) those of the original array.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)