Using strfind to find character index in word
2 ビュー (過去 30 日間)
古いコメントを表示
hi, i have a script where i must find the index of the letter e in the word each
Guess1 = e;
HangWord = "each"
index = strfind(HangWord, 'Guess1')
this returns index=[]
thank you
0 件のコメント
回答 (2 件)
Stephen23
2019 年 9 月 16 日
>> HangWord = 'each';
>> Guess1 = 'e';
>> index = strfind(HangWord, Guess1)
index = 1
0 件のコメント
Walter Roberson
2019 年 9 月 16 日
Guess1 = 'e';
HangWord = "each";
index = strfind(HangWord, Guess1);
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Characters and Strings についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!