How to split multilines text line by line in MatLab? - splitlines -- MatLab
How to split multilines text line by line in MatLab? - splitlines -- MatLab
How to split multilines text line by line in MatLab?
[Ans]
splitlines
[description]
It splits multilines text by keyword newline.
[NOTE]
Great Importance!!! Please pay a lot of attention on it!!!
It does not split it by the character '\n'.
If you wanna split it by the character '\n',
you can use
replace(s,"\n",newline)
or
compose(s)
to make a string which contains a real line (newline)
more details on:
code
clear
clc
nl=newline
s='q'
sArr=[s newline]
sArr2=[s nl]
sArr3=s+newline
sArr4=s+"\n"
class(sArr)
newS=splitlines(sArr)
newS2=splitlines(sArr2)
sArr3=string(sArr3)
class(sArr3)
newS3=splitlines(sArr3)
newS4=splitlines(sArr4)
result:
Comments
Post a Comment