Removing strings containing numbers
39 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
HIRAKJYOTI BASUMATARY
el 19 de En. de 2018
Comentada: HIRAKJYOTI BASUMATARY
el 19 de En. de 2018
If i have a string =
" 30th Birthday WORLDCUP34 WORLDCUP'34 '04 "
and i want the output to be only =
" Birthday " ,
then how can i go forward to achieve such by removing all expressions containing numbers with it.
0 comentarios
Respuesta aceptada
Birdman
el 19 de En. de 2018
Editada: Birdman
el 19 de En. de 2018
One approach:
s1="30th Birthday WORLDCUP34 WORLDCUP'34 '04";
str=strsplit(s1,' ');
result=str(cellfun(@isempty,(regexp(str,'\d+'))))
5 comentarios
Birdman
el 19 de En. de 2018
Ok Jan, thanks. It just takes time to get used to working with cellfun.
Más respuestas (0)
Ver también
Categorías
Más información sobre Birthdays 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!