using single quotes with findstr

13 ビュー (過去 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 Center および File ExchangeStartup and Shutdown についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by