# STD_GetStringNLength

## Syntax

      #include <nitro/std.h>

      int STD_GetStringNLength( char* str, int len );

      int STD_StrNLen( char* str, int len );

## Arguments

str | Specifies the string pointer.
len | Specifies the maximum return value.

## Return Values

Returns the string length when it is less than len. Returns len otherwise.

## Description

Finds the length of string `str`. If it is longer than len, however, len is returned. This has the same behavior as the `strnlen` function in the C standard library. By specifying len as the size of the array (region) that stores a string, you can prevent an abnormally large string count from being returned when the string overflows the region.

`STD_StrNLen` is defined as another name for `STD_GetStringNLength`.

## See Also

`STD_GetStringLength`

## Revision History

2008/07/31 Initial version.

CONFIDENTIAL