problem in compare strings
Show older comments
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
Accepted Answer
More Answers (1)
Jan
on 31 Jul 2012
strncmp :
str1 = 'Animation*;
str2 = 'Animation';
strncmp(str1, str2, length(str2))
1 Comment
huda nawaf
on 31 Jul 2012
Categories
Find more on String Parsing 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!