How do I determine if a word has a certain character in it?

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?

 采纳的回答

If you only want to know whether or not the letter is in the word...
hasLetter = any(myWord == 'c');

类别

帮助中心File Exchange 中查找有关 Logical 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by