I need only words when i split a string , while currently i am getting even spaces

1 次查看(过去 30 天)
string2=split(string(result{1,hh}(ss,1)),[" ",",","(",")","-"])
>> string2
string2 =
8×1 string array
"Secure"
"VPDM"
"to"
"Ebay"
"housing"
""
"optional"
""
I need the output to be
"Secure"
"VPDM"
"to"
"Ebay"
"housing"
"optional"

采纳的回答

Guillaume
Guillaume 2020-1-23
Probably the easiest is to do:
string2 = regexp(yourstring, '\w+', 'match')
  10 个评论
Walter Roberson
Walter Roberson 2020-1-24
string2 comes out as missing in that file, and there is no way that that result variable is the output of that regexp() command.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Characters and Strings 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by