Replace single quotation with single quotation and double quotation
이전 댓글 표시
답변 (2개)
David Hill
2020년 6월 6일
편집: David Hill
2020년 6월 6일
B=[char(34),A,char(34)];
B=['"',A,'"'];%or this as long as A is a character array
Image Analyst
2020년 6월 6일
Some options, depending on what you want:
A = 'Tom and Jerry' % Input
B = '"Tom and Jerry"' % Desired output
% Try one of these.
B1 = sprintf('"%s"', A)
B2 = string(A)
You'll see
A =
'Tom and Jerry'
B =
'"Tom and Jerry"'
B1 =
'"Tom and Jerry"'
B2 =
"Tom and Jerry"
카테고리
도움말 센터 및 File Exchange에서 Dates and Time에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!