# strcmp_n

Version:
Last Modified: March 15, 2017

Performs a case-sensitive comparison of the first n characters in the input strings.

## Syntax

c = strcmp_n(a, b, n)
Legacy name: strncmp

## a

String or vector of strings. MathScript first flattens string vectors before the strings will be compared.

## b

String or vector of strings. MathScript first flattens string vectors before the strings will be compared.

## n

Number of characters in a and b to compare. n is a positive integer.

## c

1 if the first n characters in a and b are the same. Otherwise, strcmp_n returns 0. c is a Boolean.

A = 'this is a test for strcmp_n'
B = 'this can not be true'
C = strcmp_n(A, B, 3)

Where This Node Can Run:

Desktop OS: Windows

FPGA: This product does not support FPGA devices