Ignore \ n (newlines)

I get a string that contains a sentence in two lines:

'hello this is my first. program matlab' 

and I want to change the sentence to be presented on the line:

 'hello this is my first.program matlab' 

How can I do this using matlab?

+4
source share
1 answer

Replace all occurrences \n with ''

  myNewSt = strrep(mySt,sprintf('\n'),''); 

For example, enter:

  strrep( sprintf('this is my \n string'),sprintf('\n'),'') 
+8
source

All Articles