IF Statements - case sensitive
6 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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
0 Kommentare
Antworten (1)
Chad Greene
am 28 Feb. 2014
Try the strcmpi function.
1 Kommentar
Chad Greene
am 28 Feb. 2014
For example:
user_input = 'plAy';
if strcmpi(user_input,'play')
disp('the user has input the word play')
end
Siehe auch
Kategorien
Mehr zu Audio and Video Data finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!