- double blip in "Children''s"
- strcmp make exact comparisons of strings - no wildcards as in 'Animation*';
- strfind is an alternative to strcmp - see the documentation
problem in compare strings
1 次查看(过去 30 天)
显示 更早的评论
hi,
if I want compare two strings
ex.
str1='Animation|Children's|Comedy'
i want to check just the first word and whatever the others words
str1='Animation*' str2= 'Animation'
i.e can I compare strcmp(str1,str2)?
thanks
0 个评论
采纳的回答
per isakson
2012-7-31
Try this
str1 = 'Animation|Children''s|Comedy';
str2 = 'Animation*';
str3 = 'Animation';
ism = strcmp( str3, regexp( str1, '\|', 'split' ) );
>> whos ism
Name Size Bytes Class Attributes
ism 1x3 3 logical
>> ism
ism =
1 0 0
Note
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Environment and Settings 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!