필터 지우기
필터 지우기

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 CenterFile Exchange에서 Characters and Strings에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by