필터 지우기
필터 지우기

How can I split a string?

조회 수: 3 (최근 30일)
pamela sulis
pamela sulis 2015년 11월 25일
답변: Walter Roberson 2015년 11월 25일
Hi, I have this string '0231563972' and i want to split it, put a space between the number: '0 2 3 1 5 6 3 9 7 2'. Can you give me suggestions?

채택된 답변

Walter Roberson
Walter Roberson 2015년 11월 25일
S = '0231563972';
newS = regexprep(S, '(.)(?=.)', '$1 ');
or
newS = strjoin(num2cell(S),' ');

추가 답변 (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