フィルターのクリア

How to deleted Enter char

3 ビュー (過去 30 日間)
Xiaoning.Wang
Xiaoning.Wang 2020 年 11 月 27 日
コメント済み: Xiaoning.Wang 2020 年 11 月 30 日
a = '
'MOVABLE,ERASABLE,
MERGEABLE'
a(18) = '
' % there hava a Enter char
I want to delete the Enter Char.
the way ('\n' or 'r' or '\r\n' ) is error. so how to delete the Enter char

採用された回答

Walter Roberson
Walter Roberson 2020 年 11 月 27 日
a = regexprep(a, '[\r\n]', '')
or
a(ismember(a, [10 13])) = ''; %10 is newline, 13 is carriage return
  1 件のコメント
Xiaoning.Wang
Xiaoning.Wang 2020 年 11 月 30 日
I like the solution, Thank you Walter Roberson

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrices and Arrays についてさらに検索

製品


リリース

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by