Case insensitive strstr...?

I wanted to use strnicmp to compare two string arrays, but it seems it does not exist in the Arduino library. I could use strstr, but strstr is case sensitive.

What is the best way of finding a string in another string without regard to case?
Or alternatively comparing the first n characters of a string without regard to case?

I could do it myself, but if there's a function already out there...?

TIA!

Nothing wrong doing it yourself. If the String string is something you receive on a serial (or other stream) byte by byte, then the easiest way is probably to put everything in lower or upper case as you receive the characters rather than later on

Cf tolower()

J-M-L:
... If the String is something you receive on a serial (or other stream) byte by byte, ...

I guess that should be string with lowercase 's' :wink:

Of course !!! :slight_smile:

Edited

Thanks to all for the suggestions, I'll maybe use the get all string to lower case suggestion...

strcasecmp()
strncasecmp()
strcasestr()

oqibidipo:
strcasecmp()
strncasecmp()
strcasestr()

Magic! Many thanks, I thought there must be something like this.

I'll be using strncasecmp I imagine.