Filter löschen
Filter löschen

using single quotes with findstr

4 Ansichten (letzte 30 Tage)
Matthew O'Brien
Matthew O'Brien am 5 Aug. 2011
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

Akzeptierte Antwort

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

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Creating and Concatenating Matrices finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by