Dissect a String and create list with Matlab

1 view (last 30 days)
Lucas S
Lucas S on 2 May 2019
Commented: Lucas S on 2 May 2019
Hello !
I come from Python and i would like, with Matlab, to dissect a string and keep each part in a List. Like that :
A = "black || white || pink || yellow"
and so i would like to have
B = ["black", "white", "pink", "yellow"]
Thanks for helping !

Accepted Answer

Jos (10584)
Jos (10584) on 2 May 2019
A = "black || white || pink || yellow"
B = split(erase(A,'|')).'

More Answers (0)


Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!