Goto main content

strncasecmp

Case-insensitive string comparison of the first n characters.

STRNCASECMP

NAME

strncasecmp - Case-insensitive string comparison of the first n characters.

SYNOPSIS

strncasecmp(str1,str2,len)

PARAMETERS

str1
The first string
str2
The second string
len
The length

RETURN

Returns < 0 if str1 is less than str2; > 0 if str1 is greater than str2, and 0 if they are equal.

EXAMPLES

in:  res=<{strncasecmp("one ","ONE SAMPLE",4)}>.
out: res=0.

in:  res=<{strncasecmp("ONE ","ONE SAMPLE",5)}>.
out: res=-115.

in:  res=<{strncasecmp("ONE SAMPLE","ONE ",4)}>.
out: res=0.

SEE ALSO

{{ include("includes/strings.sn") }}

AUTHOR

Written by Pusnei Sergey and Caroline Laplante, <sergey@sednove.com>

MODIFICATIONS

1.0 2014-09-09 21:24:14 laplante@sednove.com

Edit

© 2024 extenso Inc. All rights reserved.