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에서 String Parsing에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by