strrep for unordered string

1 view (last 30 days)
Reuben Addison
Reuben Addison on 5 Feb 2020
Commented: Stephen23 on 5 Feb 2020
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

Bhaskar R
Bhaskar R on 5 Feb 2020
What about reguler expression?
result = regexprep('Z06IL202RNP302', '(Z|IL|RNP)', '');

More Answers (0)

Categories

Find more on Get Started with MATLAB in Help Center and File Exchange

Tags

Products


Release

R2018a

Community Treasure Hunt

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

Start Hunting!