Case Insensitive String comp in C

前端 未结 11 1163
天涯浪人
天涯浪人 2020-11-27 03:45

I have two postcodes char* that I want to compare, ignoring case. Is there a function to do this?

Or do I have to loop through each use the tolower func

11条回答
  •  挽巷
    挽巷 (楼主)
    2020-11-27 04:16

    I would use stricmp(). It compares two strings without regard to case.

    Note that, in some cases, converting the string to lower case can be faster.

提交回复
热议问题