MATLAB: How to erase newline character from string

string

Hello,
I am reading an xml file that contains new line (enter) character. How do I detect and erase it?
text=a.Olay(1)
text =
"YBasla
"
As you can see there is a new line character at the end of the string. Erase could not delete it this way:
erase(text,'↵')
ans =
"YBasla
"
Note that the string looks like this in a table
a =
6×5 table
(...) Olay (...) (...) (...)
_________________ ____________________________ ______________________ _________ __________
(...) "YBasla↵" (...) (...) (...)
I uploaded table and the text variable so that you can play with them.

Best Answer

strtrim(text)