MATLAB: Doing a ‘strfind’ with apostrophe in the string

apostrophestrfind

i have to do a strfind for the following phrase:
'REACQ'='N'
But when I go to do A = strfind(B, ''REACQ'='Y''), then there are clearly too many apostrophes in the code for MATLAB to know what to do..

Best Answer

Use double apostrophes everywhere you have an apostrophe in your string, e.g:
A = findstr('''', '''REACQ''=''Y''')