case insensitive strfind?
61 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
New
am 24 Jul. 2011
Kommentiert: Tord Bjørnevaagen
am 11 Aug. 2017
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
0 Kommentare
Akzeptierte Antwort
Titus Edelhofer
am 24 Jul. 2011
Hi,
one simple method would be to use lower on both the sentences and the words you are using ...
Titus
1 Kommentar
Tord Bjørnevaagen
am 11 Aug. 2017
I just used this solution, thanks!
strfind(lower(bigText),lower(keyword))
Weitere Antworten (2)
Bjorn Gustavsson
am 24 Jul. 2011
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.
Siehe auch
Kategorien
Mehr zu Characters and Strings 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!