how to create string includes '

조회 수: 3 (최근 30일)
michael scheinfeild
michael scheinfeild 2015년 4월 30일
편집: Thorsten 2015년 4월 30일
i have string ['_ ,,,77 - -'''''"''"i''-_G8" ']
but it is illegal how to create it

채택된 답변

Thorsten
Thorsten 2015년 4월 30일
편집: Thorsten 2015년 4월 30일
Use
''
for every
'
that you need in string, like:
disp('That''s not hard to understand.')
or
>> mystring = '[''_ ,,,77 - -''''''''''"''''"i''''-_G8" '']'
mystring =
['_ ,,,77 - -'''''"''"i''-_G8" ']

추가 답변 (2개)

michael scheinfeild
michael scheinfeild 2015년 4월 30일
not works b='abc"'
b =
abc"
  댓글 수: 1
Thorsten
Thorsten 2015년 4월 30일
편집: Thorsten 2015년 4월 30일
' is used in Matlab to indicate the start and end of a string, but the ' are not part of the string. To get the ' as part of the string, you have to type them twice (enclosed by ' to denote a Matlab string):
b='''abc"'''

댓글을 달려면 로그인하십시오.


michael scheinfeild
michael scheinfeild 2015년 4월 30일
but the length is ok so it may be helpful to me

카테고리

Help CenterFile Exchange에서 String Parsing에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by