IF Statements - case sensitive
이전 댓글 표시
I am writing an IF statement. The user is prompt to enter the word "play" to begin, how do I write it so it is not case sensitive. For example they could enter "Play" or pLay" or PLAy" and it would accept the word
답변 (1개)
Chad Greene
2014년 2월 28일
0 개 추천
Try the strcmpi function.
댓글 수: 1
Chad Greene
2014년 2월 28일
For example:
user_input = 'plAy';
if strcmpi(user_input,'play')
disp('the user has input the word play')
end
카테고리
도움말 센터 및 File Exchange에서 Audio and Video Data에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!