Hey Coda, here’s a list for you. Now, I want you to slice out only part of the list, starting here and ending here.
Splice()
Removes and adds values to a list
put a bit simpler...
Hey Coda, Im going to give you a list, but I want to change it a bit. Sometimes I want to add values, and sometimes delete them. Oh! Can I also specify where in that list I want you to do that?
Slice() and Splice() share some parameters while also having some of their own. For simplicity, we will look at each formula’s parameters separately.
Slice() has three parameters:
Value
Slice(Value, Start, End)
A piece of text or list of values.
Start
Slice(Value, Start, End)
Position in list you want to start from.
End
Slice(Value, Start, End)
Position in list at which you want to end.
Splice() has four parameters:
Value
Splice(Value, Start, DeleteCount, InsertValue)
A piece of text or a list of values.
Start
Splice(Value, Start, DeleteCount, InsertValue)
Position in list you want to start from.
DeleteCount
Splice(Value, Start, DeleteCount, InsertValue)
The number of items you want to delete.
InsertValue
Splice(Value, Start, DeleteCount, InsertValue)
Values, text, list you want to insert.
Slice
Slice() takes a list and allows you to get a smaller portion of that list. Just like a pizza slice is a smaller section of a whole!
List of 21 Countries:
South KoreaKuwaitCayman IslandsKazakhstanLaosLebanonSaint LuciaLiechtensteinSri LankaLiberiaLesothoLithuaniaLuxembourgLatviaLibyaMoroccoMonacoMoldovaMontenegroMadagascarMarshall Islands
Use the sliders below to return a slicedportion of the list.
Give me a sliced list starting from this position:
00
11
Give me back a total list of countries this large:
00
4
LesothoLithuaniaLuxembourgLatviaLibya
Tables are also lists! Watch how you can choose how many plants you would like to see from our