フィルターのクリア

comparing two equal strings

2 ビュー (過去 30 日間)
Bharat
Bharat 2014 年 11 月 27 日
編集済み: Adam 2014 年 11 月 27 日
Hello everyone. How do i return false when comparing two equal strings? i have two strings x = 'MIH06' and y= 'MIH06'. I want strcmp(x,y) to return false when compared . (I don't think strcmp does the job. Please suggest). Thanks.

回答 (1 件)

Adam
Adam 2014 年 11 月 27 日
編集済み: Adam 2014 年 11 月 27 日
~strcmp( str1, str2 )
strcmp compares the two strings for equality. In your case the two strings are equal so you can't expect the function itself to return false so just negate its returned value.

カテゴリ

Help Center および File ExchangeCharacters and Strings についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by