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!
===2005: [[Friendly interactive shell|fish]]=== Arrays in [[Friendly interactive shell|fish]] are always one-based, thus the indices of a new slice will begin with ''one'', regardless of the previous indices. <syntaxhighlight lang="fishshell"> > set A (seq 3 2 11) # $A is an array with the values 3, 5, 7, 9, 11 > echo $A[(seq 2)] # Print the first two elements of $A 3 5 > set B $A[1 2] # $B contains the first and second element of $A, i.e. 3, 5 > set -e A[$B]; echo $A # Erase the third and fifth elements of $A, print $A 3 5 9 </syntaxhighlight>
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)