Why Don't We Use == To Compare Strings In Matlab

后端 未结 3 1033
深忆病人
深忆病人 2020-12-20 17:31

I know it\'s commonly accepted that using strcmp is the proper way to compare strings, but my question is why? According to the help:

A =

3条回答
  •  -上瘾入骨i
    2020-12-20 18:24

    Another small exception is with empty strings.

    Using '' == '' in if statement evaluates to false.

    strcmp('','') is true.

提交回复
热议问题