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.

 Akzeptierte Antwort

Bhaskar R
Bhaskar R am 5 Feb. 2020

0 Stimmen

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

Weitere Antworten (0)

Kategorien

Mehr zu Startup and Shutdown finden Sie in Hilfe-Center und File Exchange

Produkte

Version

R2018a

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by