How to deleted Enter char

3 次查看(过去 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

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Matrices and Arrays 的更多信息

产品


版本

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by