How do I determine if a word has a certain character in it?
7 views (last 30 days)
Show older comments
Rebecca Hussey
on 4 Nov 2015
Commented: Image Analyst
on 5 Nov 2015
How do I determine if a word has a certain character in it?
For example if I have a word ?????? and want to know if the letter c is in it?
0 Comments
Accepted Answer
TastyPastry
on 4 Nov 2015
Edited: TastyPastry
on 4 Nov 2015
If you only want to know whether or not the letter is in the word...
hasLetter = any(myWord == 'c');
1 Comment
More Answers (1)
See Also
Categories
Find more on Characters and Strings in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!