using single quotes with findstr

조회 수: 7 (최근 30일)
Matthew O'Brien
Matthew O'Brien 2011년 8월 5일
Hi
I have the following:
test = '''any word'''
which creates a char array containing the word with quotes
now i want to find the position of the quotes:
out = findstr(test,' '' ' )
but this doesn't work and returns an empty array. Can someone please explain how to do this and also why i cant use the escape sequence for single quotes i used to create the word in the first place.
Im using R2008b
Thanks
Matt

채택된 답변

Oleg Komarov
Oleg Komarov 2011년 8월 5일
strfind(test,'''')
With ' '' ' you are looking for < blank>'<blank>
  댓글 수: 2
Matthew O'Brien
Matthew O'Brien 2011년 8월 5일
very fast answer! Thanks alot....sometimes the simple things causes all the problems :)
Jan
Jan 2011년 8월 5일
And if this heap of quotes looks confusing:
strfind(test, char(39)).

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by