Ignore \n (newline characters)

matlab, newline, string

Solution

Replace all occurrences of `\n` to `''`

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

For example, type:

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

Problem

I get a string which contains a sentence in two lines : ``` 'hello this is my first. program matlab' ``` and I want to change the sentence to be represend in on line: ``` 'hello this is my first.program matlab' ``` How could I do it with matlab ?

Original source