I need to convert a string of boolean indices into an array which would look like this:
convert('11001') = [1 2 5]
convert('0000') = []
convert('001') = [3]
I don't control the function which produces the string.
Any ideas to do this in an elegant way? I already did it whith a loop but it looks wrong somehow.