フィルターのクリア

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 Center および File ExchangeCharacters and Strings についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by