strrep for unordered string

I have a string 'Z06IL202RNP302' I want to take out 'Z', 'IL' and 'RNP', how do I use strrep to achieve that. Do I do it multiple times.

 Accepted Answer

What about reguler expression?
result = regexprep('Z06IL202RNP302', '(Z|IL|RNP)', '');

More Answers (0)

Categories

Products

Release

R2018a

Tags

Community Treasure Hunt

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

Start Hunting!