Removing strings containing numbers

2 次查看(过去 30 天)
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.

采纳的回答

Birdman
Birdman 2018-1-19
编辑:Birdman 2018-1-19
One approach:
s1="30th Birthday WORLDCUP34 WORLDCUP'34 '04";
str=strsplit(s1,' ');
result=str(cellfun(@isempty,(regexp(str,'\d+'))))
  5 个评论
Birdman
Birdman 2018-1-19
Ok Jan, thanks. It just takes time to get used to working with cellfun.
HIRAKJYOTI BASUMATARY
@Birdman Sir and @Jan Simon Sir , thanks a lot for the guidance. Yes @Jan simon sir, i meant in a single cell.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 MATLAB 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by