Using strfind to find character index in word
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponses (2)
Stephen23
le 16 Sep 2019
>> HangWord = 'each';
>> Guess1 = 'e';
>> index = strfind(HangWord, Guess1)
index = 1
0 commentaires
Walter Roberson
le 16 Sep 2019
Guess1 = 'e';
HangWord = "each";
index = strfind(HangWord, Guess1);
0 commentaires
Voir également
Catégories
En savoir plus sur Characters and Strings dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!