StrContains Function

Tests whether a string is found inside another string.

int StrContains(const char[] str, const char[] substr, bool caseSensitive)


const char[] str

String to search in.

const char[] substr

Substring to find inside the original string.

bool caseSensitive

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

Return Value

-1 on failure (no match found). Any other value indicates a position in the string where the match starts.