strncmp

Last Updated2007-04-11
Created At2007-04-11

Compares two strings parts lexographically.

native int strncmp(const char[] str1, const char[] str2, int num, bool caseSensitive = true)

Parameters

const char[] str1
First string (left).
const char[] str2
Second string (right).
int num
Number of characters to compare.
bool caseSensitive
If true (default), comparison is case sensitive. If false, comparison is case insensitive.

Return Value

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