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"
0 个评论
采纳的回答
Guillaume
2020-1-23
Probably the easiest is to do:
string2 = regexp(yourstring, '\w+', 'match')
10 个评论
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 Center 和 File Exchange 中查找有关 Characters and Strings 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!