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''') Related SolutionsMATLAB: Regexprep() skip first occurrence How about using regexp to find the position of spaces, and delete 2nd~Nth spaces? Like:mystring = 'this is my string';pos = regexp(mystring,'\s');mystring(pos(2:end)) = []; MATLAB: Remove apostrophe Did you try str2double()? Related QuestionStrfind issueHow to make character StringHow the remove single apostrophe from a stringHow to determine if a word has a certain character in itStrfind first occurrence.
Best Answer