For example, I would like to partition {1,2,3,4,5} into
{1}
{1,2}
{1,2,3}
{1,2,3,4}
{1,2,3,4,5}
with just one line of code. Is there any way to do this? I am working with a much larger data set and do not want to have to separate the list into shorter and shorter lists manually. Thank you for your help.
ReplaceList[{1, 2, 3, 4, 5}, {x__, ___} :> {x}]. By the way this question is a duplicate; help finding the original is appreciated. – Mr.Wizard Jan 29 '16 at 00:10