忽略\n(换行符)

lol*_*ola 4 string matlab newline

我得到一个包含两行句子的字符串:

'hello this is my first.
program matlab'
Run Code Online (Sandbox Code Playgroud)

我想在线更改要代表的句子:

'hello this is my first.program matlab'
Run Code Online (Sandbox Code Playgroud)

我怎么能用matlab做到这一点?

And*_*ein 8

替换所有出现的\n''

   myNewSt = strrep(mySt,sprintf('\n'),'');
Run Code Online (Sandbox Code Playgroud)

例如,键入:

   strrep( sprintf('this is my \n string'),sprintf('\n'),'')
Run Code Online (Sandbox Code Playgroud)