strrep for unordered string

1 visualización (últimos 30 días)
Reuben Addison
Reuben Addison el 5 de Feb. de 2020
Comentada: Stephen23 el 5 de Feb. de 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.

Respuesta aceptada

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

Más respuestas (0)

Categorías

Más información sobre Get Started with MATLAB en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by