case insensitive strfind?
Ältere Kommentare anzeigen
I have a matrix in which there are about 100,000 sentences that I want to scan for the existence of certain words (True/false). For previous scans, searching for one exact word, I used the strfind. Nevertheless, now I have a list of 18 words which might be written in lower or upper cases in the sequences. The strcmpi which could be useful in this case only returns positive if the whole sentence consist of the word... Is there another function I missed?
Thank you
Akzeptierte Antwort
Weitere Antworten (2)
Fangjun Jiang
am 24 Jul. 2011
1 Stimme
use regexpi
1 Kommentar
Turner
am 20 Aug. 2013
takes 10 times longer than lower/upper followed by strfind() in my benchmark
Bjorn Gustavsson
am 24 Jul. 2011
0 Stimmen
Use: strcmpi
2 Kommentare
Walter Roberson
am 25 Jul. 2011
strcmpi() is not suitable for substring searches. See http://www.mathworks.com/help/techdoc/ref/strcmpi.html about what it _does_ do.
Bjorn Gustavsson
am 25 Jul. 2011
I misread the original poster's strfind as strcmp...
Kategorien
Mehr zu Characters and Strings finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!