Borrar filtros
Borrar filtros

How to deleted Enter char

3 visualizaciones (últimos 30 días)
Xiaoning.Wang
Xiaoning.Wang el 27 de Nov. de 2020
Comentada: Xiaoning.Wang el 30 de Nov. de 2020
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

Respuesta aceptada

Walter Roberson
Walter Roberson el 27 de Nov. de 2020
a = regexprep(a, '[\r\n]', '')
or
a(ismember(a, [10 13])) = ''; %10 is newline, 13 is carriage return
  1 comentario
Xiaoning.Wang
Xiaoning.Wang el 30 de Nov. de 2020
I like the solution, Thank you Walter Roberson

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Matrices and Arrays en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by