Scroll to navigation

strcasecmp(3) Library Functions Manual strcasecmp(3)

NOMBRE

strcasecmp, strncasecmp - comparan dos cadenas sin distinguir entre mayúsculas o minúsculas

BIBLIOTECA

Biblioteca Estándar C (libc, -lc)

SINOPSIS

#include <strings.h>
int strcasecmp(const char *s1, const char *s2);
int strncasecmp(const char s1[.n], const char s2[.n], size_t n);

DESCRIPCIÓN

La función strcasecmp() compara byte a byte las dos cadenas s1 y s2, sin distinguir entre mayúsculas y minúsculas. Devuelve un entero menor , igual o mayor que cero si se encuentra s1, respectivamente, es menor, igual, o mayor que s2.

La función strncasecmp() es similar, excepto que sólo compara los primeros caracteres n de s1 y s2.

VALOR DEVUELTO

The strcasecmp() and strncasecmp() functions return an integer less than, equal to, or greater than zero if s1 is, after ignoring case, found to be less than, to match, or be greater than s2, respectively.

ATRIBUTOS

Para obtener una explicación de los términos usados en esta sección, véase attributes(7).

Interfaz Atributo Valor
strcasecmp(), strncasecmp() Seguridad del hilo Configuración regional de multi-hilo seguro

ESTÁNDARES

4.4BSD, POSIX.1-2001, POSIX.1-2008.

NOTAS

The strcasecmp() and strncasecmp() functions first appeared in 4.4BSD, where they were declared in <string.h>. Thus, for reasons of historical compatibility, the glibc <string.h> header file also declares these functions, if the _DEFAULT_SOURCE (or, in glibc 2.19 and earlier, _BSD_SOURCE) feature test macro is defined.

El estándar POSIX.1-2008 dice de estas funciones:

When the LC_CTYPE category of the locale being used is from the POSIX locale, these functions shall behave as if the strings had been converted to lowercase and then a byte comparison performed. Otherwise, the results are unspecified.

VÉASE TAMBIÉN

memcmp(3), strcmp(3), strcoll(3), string(3), strncmp(3), wcscasecmp(3), wcsncasecmp(3)

TRADUCCIÓN

La traducción al español de esta página del manual fue creada por Miguel Pérez Ibars <mpi79470@alu.um.es> y Marcos Fouces <marcos@debian.org>

Esta traducción es documentación libre; lea la GNU General Public License Version 3 o posterior con respecto a las condiciones de copyright. No existe NINGUNA RESPONSABILIDAD.

Si encuentra algún error en la traducción de esta página del manual, envíe un correo electrónico a debian-l10n-spanish@lists.debian.org.

7 Enero 2023 Páginas de manual de Linux 6.03