strcmp Function

Compares two strings lexographically.

int strcmp(const char[] str1, const char[] str2, bool caseSensitive)

Parameters

const char[] str1

First string (left).

const char[] str2

Second string (right).

bool caseSensitive

If true (default), comparison is case sensitive. If false, comparison is case insensitive.

Return Value

-1 if str1 < str2 0 if str1 == str2 1 if str1 > str2