Split string with successive delimiters
    조회 수: 7 (최근 30일)
  
       이전 댓글 표시
    
Hi,
I have a string, A = 'matlab,2016,b,,,'
I am trying to extract the characters between the commas using strsplit. however, at the end of the string there are no space between the comma delimiters, and they get grouped as one cell, instead of empty cell.
How can split the string, with the comma as the delimiter, and no space between successive delimiters being treated as a blank cell?
thanks!
s
댓글 수: 0
채택된 답변
  Walter Roberson
      
      
 2017년 4월 21일
        >> A = 'matlab,2016,b,,,'
A =
    'matlab,2016,b,,,'
>> regexp(A,',','split')
ans =
  1×6 cell array
    'matlab'    '2016'    'b'    ''    ''    ''
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
				Help Center 및 File Exchange에서 Matrices and Arrays에 대해 자세히 알아보기
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

