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!