Spell out the Revu'a
Dyalog APL, 2 bytes
,\
Cumulative reduce by concatenate. Try it here.
The formatting of the output is nicer when you prefix a ⍕
, but it clearly shows the correct order without.
JavaScript (ES6), 27 26 25 bytes
Saved one byte thanks to @nicael and @MartinBüttner, one thanks to @Neil
x=>x.replace(/.?/g,"$` ")
Takes advantage of some built-in features of JS's .replace
function. Specifically, in the replacement, $`
becomes everything preceding the matched character. Using the regex /.?/g
rather than /./g
means it also matches the empty string at the end.
Japt, 10 4 bytes
I didn't realize that a cumulative reduce would be so useful in this case. :-)
UŒ+
Outputs as an array, comma-separated by default. If this is not allowed, use this 6-byte code instead:
U¬å+ ·
Try it online!
How it works
// Implicit: U = input string
U¬ // Split U into chars.
å+ // Cumulative reduce: loop through each item in the array, concatenating it to the total.
// ["t","e","s","t"] => ["t","te","tes","test"].
// Implicit: output last expression