Skip to main content
edited body
Source Link
kglr
  • 403.4k
  • 18
  • 501
  • 959
 ReplaceList[lst={a, b, c, d},;  ReplaceList[lst,{x__, ___} :> {x}] 

Speaking of "common operation":

 Table[lst[[;; i]], {i, Length@lst}] 
 ReplaceList[{a, b, c, d}, {x__, ___} :> {x}] 
 lst={a,b,c,d};  ReplaceList[lst,{x__, ___} :> {x}] 

Speaking of "common operation":

 Table[lst[[;; i]], {i, Length@lst}] 
edited body
Source Link
kglr
  • 403.4k
  • 18
  • 501
  • 959
 ReplaceList[{a, b, c, d}, {x__, ___} -:> {x}] 
 ReplaceList[{a, b, c, d}, {x__, ___} -> {x}] 
 ReplaceList[{a, b, c, d}, {x__, ___} :> {x}] 
Source Link
kglr
  • 403.4k
  • 18
  • 501
  • 959

 ReplaceList[{a, b, c, d}, {x__, ___} -> {x}]