strncmp
Compare the first n characters of two strings (case-sensitive).
Syntax
Section titled “Syntax”tf = strncmp(str1, str2, n)Description
Section titled “Description”Returns true when the first n characters of str1 and str2 are identical (including case), false otherwise.
Examples
Section titled “Examples”strncmp('hello world', 'hello there', 5) % 1strncmp('hello world', 'hello there', 6) % 0