case insensitive strfind?
古いコメントを表示
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
採用された回答
その他の回答 (2 件)
Fangjun Jiang
2011 年 7 月 24 日
1 投票
use regexpi
1 件のコメント
Turner
2013 年 8 月 20 日
takes 10 times longer than lower/upper followed by strfind() in my benchmark
Bjorn Gustavsson
2011 年 7 月 24 日
0 投票
Use: strcmpi
2 件のコメント
Walter Roberson
2011 年 7 月 25 日
strcmpi() is not suitable for substring searches. See http://www.mathworks.com/help/techdoc/ref/strcmpi.html about what it _does_ do.
Bjorn Gustavsson
2011 年 7 月 25 日
I misread the original poster's strfind as strcmp...
カテゴリ
ヘルプ センター および File Exchange で Characters and Strings についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!