添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
气宇轩昂的铁链  ·  Etcd - Storage ...·  2 小时前    · 
眼睛小的蚂蚁  ·  Signature Does Not ...·  7 小时前    · 
耍酷的红烧肉  ·  テスト85 #ExcelVBA - Qiita·  10 小时前    · 
逆袭的打火机  ·  C# URL Encode (How It ...·  19 小时前    · 
冷冷的沙发  ·  golang mysql datetime ...·  11 月前    · 
冷静的香菇  ·  crash on ...·  1 年前    · 
Working with a string array is different than working with a char array. What Walter wrote is true for char arrays (which was the main data type for storing text data in 2011, as the string class didn't exist yet.)
button = "button" ;
str = 'abcde' ;
if contains(str, button)
disp( "[" + str + "] contains the string [" + button + "]" )
else
disp( "[" + str + "] doesn't contain the string [" + button + "]" )
end
Now change the contents of the str variable and perform the same comparison.
str = 'space button' ;
if contains(str, button)
disp( "[" + str + "] contains the string [" + button + "]" )
else
disp( "[" + str + "] doesn't contain the string [" + button + "]" )
end
The contains function can accept two char vectors, two string arrays, two cell arrays containing char vectors, or a combination of those three types.

Community Treasure Hunt

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

Start Hunting!