Splitting the string using regular expression or string split
6 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Gopalakrishnan venkatesan
el 5 de Mayo de 2015
Editada: Gopalakrishnan venkatesan
el 5 de Mayo de 2015
'a_bb_ccc_ddd_eeeeee_ffff_gg_h_i'
I have a string like this.
I need to split the string as
a_bb_ccc
ddd_eeeeeee
ffff_gg_h_i
how to use the regular expression or stringsplit in order to get the above output?
3 comentarios
Respuesta aceptada
Jan
el 5 de Mayo de 2015
s = 'a_bb_ccc_ddd_eeeeee_ffff_gg_h_i'
index = strfind(s, '_');
parts = {s(1:index(3)-1), s(index(3)+1:index(5)-1), s(index(5)+1:end)}
1 comentario
Gopalakrishnan venkatesan
el 5 de Mayo de 2015
Editada: Gopalakrishnan venkatesan
el 5 de Mayo de 2015
Más respuestas (0)
Ver también
Categorías
Más información sobre Characters and Strings en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!