I want to separate 8 number together like 20070101, <Year> 2007, <Month>01, <Day>01, how can I do?

 Respuesta aceptada

Stephen23
Stephen23 el 28 de Sept. de 2019
>> str = '20070101';
>> rgx = '(?<year>\d{4})(?<month>\d{2})(?<day>\d{2})';
>> out = regexp(str,rgx,'names')
out =
year: '2007'
month: '01'
day: '01'

Más respuestas (0)

Categorías

Más información sobre Characters and Strings en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 28 de Sept. de 2019

Comentada:

el 28 de Sept. de 2019

Community Treasure Hunt

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

Start Hunting!

Translated by