---
layout: "default"
title: "Slice"
description: "Swift documentation for 'Slice': A view into a sub-sequence of elements of another collection."
keywords: "Slice,struct,swift,documentation,contains,dropFirst,dropFirst,dropLast,dropLast,elementsEqual,enumerate,filter,flatMap,flatMap,forEach,generate,indexOf,lexicographicalCompare,map,maxElement,minElement,popFirst,popLast,prefix,prefixThrough,prefixUpTo,reduce,removeFirst,reverse,sort,split,startsWith,suffix,suffixFrom,underestimateCount,count,endIndex,fir