Reputation: 5789
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 ?
Upvotes: 4
Views: 8995
Reputation: 20915
Replace all occurrences of \n
to ''
myNewSt = strrep(mySt,sprintf('\n'),'');
For example, type:
strrep( sprintf('this is my \n string'),sprintf('\n'),'')
Upvotes: 8