Given a string and a vector of integers, break the string into chunks whose lengths are given by the elements of the vector. Extra characters leftover at the end should be dropped. Example:
break_string('I seem to be having tremendous difficulty with my lifestyle',[4 1 5 22])
should return a 4x1 cell array:
ans = 'I se' 'e' 'm to ' 'be having tremendous d'
Additional test cases have been added.
8390 Solvers
Back to basics 21 - Matrix replicating
900 Solvers
Generate a vector like 1,2,2,3,3,3,4,4,4,4
1553 Solvers
152 Solvers
308 Solvers